-
1. Re: synchronizing a session bean
darranl Sep 10, 2004 12:16 PM (in response to twutort)You could configure the session bean so that it is in a pool with a strict maximum size of 1.
That way you will never get more than one client calling the session bean.
If you look at the 'Free Docos' to the right you should get access to the administrators and developers guide which describes configuring the container. -
2. Re: synchronizing a session bean
twutort Sep 10, 2004 1:24 PM (in response to twutort)Thanks. Can this be done for one particular session bean and not the others?
-
3. Re: synchronizing a session bean
darranl Sep 11, 2004 5:48 AM (in response to twutort)Yes this can be done for just one session bean.
In your JBoss.xml you define the new container configuration probably by extending an existing config. For the bean concerned you specify that it should use the new config instead of the existing config. -
4. Re: synchronizing a session bean
twutort Sep 13, 2004 8:37 AM (in response to twutort)Thanks. Can you synchronize within a class that the session bean uses? For example, the session bean calls class B. Is it possible to do the synch within the class B and not inside the session bean?
-
5. Re: synchronizing a session bean
darranl Sep 14, 2004 8:32 AM (in response to twutort)You should probably wrap the class with it's own session bean if that is what you are trying to achieve.
-
6. Re: synchronizing a session bean
frito Sep 14, 2004 10:26 AM (in response to twutort)@twutort:
reading the words "session bean", "synchronized", "socket" and "singleton" in one posting is scaring me a bit ;-)
Since the singleton (and therefore the synchronisation) depends on the deployment (a singleton is a singleton for a specific ClassLoader) i won't rely on this.
I recommend using a real singleton with synchronisation by implementing a MBean which does the socket things. The session bean calls the MBean and you don't have to deal with "a single instance session bean"