Results 1 to 2 of 2
Thread: question about java rmi
- 06-30-2009, 01:21 PM #1Member
- Join Date
- Jun 2009
- Rep Power
question about java rmi
One session bean queries a database and the other one makes
permanent changes to the database. Why are they both stateless?
If two or more RMI clients, running at the same time, look up the same
bound name in the registry, is the result always a reference to the same
Explain under what circumstances a problem could arise with such
concurrent RMI clients and without doing any coding, say how you could
avoid or limit such problems.
- 07-01-2009, 08:15 AM #2
Here are some very non-definitive answers to your questions...
The first question seems to deal with EJB. I don't know anything about EJB, but stateless means that each client request is handled independently of the previous request; that is, EJB doesn't keep track of values from previous requests from the same client.
The reason is that keeping track of session state is very costly, especially in a server that is designed to handle very large transaction volumes from many clients. Your application design should take into account that each transaction is independent of the others.
As for the second question, the answer should generally be "yes". However, that assumes that the look ups are identical and that a third process is not updating the registry.
Your third question sounds like an assignment from CS 510. However, ensuring that your registry doesn't change often and that changes are followed by flushing any caches would be a good start. If your "registry" is actually replicated over a number of servers, look at the replication process and the schedule, to ensure the servers are synchronized when the requests occur. Last, look at the registry entries themselves. The entries may have multiple references associated with them, and the service and clients may have discretion about which reference to use.
- By Godsent in forum New To JavaReplies: 4Last Post: 04-18-2009, 02:00 PM
- By ronakppatel in forum Web FrameworksReplies: 1Last Post: 10-01-2008, 01:13 PM
- By rose in forum New To JavaReplies: 3Last Post: 05-07-2008, 08:34 PM
- By Jay-1.1 in forum New To JavaReplies: 11Last Post: 05-01-2008, 05:04 PM
- By toad in forum New To JavaReplies: 1Last Post: 10-29-2007, 07:13 AM