File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Does EJB Container rollbacks the Transaction in case of a RuntimeException??

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am having a query in understanding rollback of the Transactions in case of a RuntimeException .

Please let me know this

While executing a Method in case of a Runtime Exception , will the container will automatically rollback the Transaction ??


Thanks in advance .
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on the transaction attributes of the method.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have set it to NOT SUPPOURTED , will the rollback of the Transaction will happen in case of a RuntimeException ??

Thanks in advance .
 
Joe Harry
Ranch Hand
Posts: 10045
3
Eclipse IDE Mac PPC Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravi Kiran V wrote:I have set it to NOT SUPPOURTED , will the rollback of the Transaction will happen in case of a RuntimeException ??

Thanks in advance .


When you set it to NOT_SUPPORTED, then there is no transaction at all. So RuntimeException won't do anything!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic