Splitting "sessions" between clients

Discussions

EJB design: Splitting "sessions" between clients

  1. Splitting "sessions" between clients (3 messages)

    Our application is called by different JVMs that may be using the same "session". Is there a way to split a session between clients so that they can use the same stateful sessionbean?

    In other words: We have a state that should live as long as the "session" lives but the session might be called by two different clients because the calling application might already have split (while loadbalancing) the session to two different JVMs. The calling application refers to the "session" only by a key.

    Is there another way of referencing a stateful sessionbean but using the home interface or do I have to use an EntityBean?

    ...or would an entitybean bean be overkill when data is only useful during the "session".

    My problem seems to be that the what I call a session does not map directly to the EJBSession definition.

    Any comments/help on this issue would be very appreciated!!!

    /Niklas
       

  2. Hi,

    If your server do not need to run in a clustered environment (only 1 VM), you could probably put your state into a singleton object that is accessed by stateless session beans.

    rubberben
  3. Unfortunately we really need to use a cluster, any suggestions? We will probably use about 10 CPUs initially!

    /Niklas
  4. You're probably better off using a database as a state cache since concurrent access of a single stateful session bean by multiple client will throw an exception by the container.