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.
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.