This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setRollbackOnly problem in EJB  RSS feed

 
Suvoraj Biswas
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one ejb bean method where in the catch section I am mentioning setRollbackOnly. Now if I throw a new custom exception from the method setRollbackOnly is getting executed.

Is there any way to get rid of that?
Any help will be appreciated.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you throwing your new custom exception from within your try block? Transactions are not rolled back for custom exceptions unless you explicitly handle them (or unless your custom exception is a runtime exception). Could you post your code?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!