Results 1 to 2 of 2
  1. #1
    hakimade is offline Member
    Join Date
    Jun 2009
    Posts
    3
    Rep Power
    0

    Default 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
    remote object?

    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.

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    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.

Similar Threads

  1. Java swing question
    By Godsent in forum New To Java
    Replies: 4
    Last Post: 04-18-2009, 02:00 PM
  2. Java Architecture Question
    By ronakppatel in forum Web Frameworks
    Replies: 1
    Last Post: 10-01-2008, 01:13 PM
  3. need a java code for this question!
    By rose in forum New To Java
    Replies: 3
    Last Post: 05-07-2008, 08:34 PM
  4. Java Question
    By Jay-1.1 in forum New To Java
    Replies: 11
    Last Post: 05-01-2008, 05:04 PM
  5. Java Review Question
    By toad in forum New To Java
    Replies: 1
    Last Post: 10-29-2007, 07:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •