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.
I will access a Statefull Session Bean (SFSB) do to a little work for me. I have a web application and take care that every user have his own SFSB to avoid multiple access. Now I have the following problem with my SFSB and JBoss 3.2.6 : When one user double click or click to fast two different links (which were processed by the same SLSB) I get the following exception :
javax.ejb.EJBException: Application Error: tried to enter Stateful bean with different tx context, contextTx: TransactionImpl:XidImpl
I have read in EJB Spec that the behaviour is while during the first transaction run the second transaction is not authorized to enter the SFSB.
Now my question : How can I avoid that the SFSB is called when a transaction is running ?
Not sure if I can help you much, since I'm not using JBoss very often. The only hint I can provide you is related to my experience with weblogic. I know that weblogic has a special tag <allow-concurrent-calls> (which defaults to false) that basically overcomes this limitation and will allow concurrent method calls to the same SFSB instance. Check on the JBoss forum maybe there is a similar configuration for JBoss as well. Regards.
I think, therefore I exist -- Rene Descartes
Joined: Feb 17, 2005
Another way you might overcome this problem is to use the business delegate pattern, synchronizing the access methods in your business delegate. Something like this: