This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Promlem with Transactions in EJB  RSS feed

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

I am facing a problem with using SessionContext's setRollbackOnly method.
I am having 3 EJB's(Suppose A,B,C) in which A calls a method in B and this method calls a method in C.
I perform a database operation, where it waits for a lock and finally database transaction times out and finally the exception is passed back to A.
And finally in A, i call the setRollbackOnly method, where it throws the java.lang.IllegalStateException saying 'Cannot mark the transaction for rollback'.

All the three beans are container managed and i have a transaction attribute 'Required' set in the descriptor file.

Can some one help me out with this.

Regards,
Dilip
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the transaction times out, there is nothing to rollback. Usually, 30 seconds is plenty of time for a transaction to complete (this is the default transaction timeout for some EJB servers). If it taking longer, you need to find out why.
 
Dilip Maddala
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is solved but
I have this EJB as a webservice which and when the Transaction is Timed out in the EJB, the same exception is being thrown at the soap client as response.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!