Win a copy of Create an Uber Clone in 7 Days: Build a real world full stack mobile app in Java this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

setRollbackOnly problem in EJB  RSS feed

 
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.
 
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?
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!