Hi all-
I have a question reagrding EJBs and syncronization of resources: I'm getting conflicting info, basically that I can and cannot use 'syncronized'.
What I need to do (this is somewhat similar to the lock table in the
SCJD exam) is to use a singleton to issue pre-instantiated MQ connections to callers. The callers would use a stateless session bean to get the reference to the MQ Session Manager singleton which would manage connections through a hashtable (the lock table).
I know hashtable is syncronized but I believe there is still a window between the get (checking for whether a connection has been issued) and a put (marking the connection as in-use).
In the non-EJB model, I could simply syncronize the method which does the get and put.
Can I do this in the singleton that is called by a stateless session bean? I've seen an example of a statefull bean that does something similar (basically syncronizing he singleton instance, locking in that manner).
thanks in advance,
Max Tomlinson