• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Application Error: tried to enter Stateful bean with different tx context, contextTx

 
Chris Jackal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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 ?

Regards

Chris
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chris,

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.
 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

Client --> Servlet/JSP --> BusinessDelegate(synchronized method) --> Bean

You might store the business delegate in the HttpSession object and must be serializable (most servlet engines passivates HttpSession objects).
Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic