This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I'm using stateless session beans for the project I'm currently working on. I understand that the container can instantiate as many instances of each bean as it feels it needs. I have one particular method that requires that it is the ONLY one running at any one particular time no matter which instance it was invoked on. Does the container handle this automatically or do I need to specify something on the method, at deployment time or . . . .I don't know what else there is. Any suggestions/solutions will be greatly appreciated Thanks ROland
How about extracting that one method into a separate bean and configure the maximum pool size to 1 using the vendor deployment descriptor? Otherwise you'd have to either make a similar limitation to the whole bean, or play with the synchronized keyword, which is a bit dangerous (disallowed by the specification).