• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic