This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can i rollback a transaction in EJB2.0 by thorowing an EJBException explicitly?  RSS feed

 
Sampath Uppula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i rollback a transaction in EJB by thorowing an EJBException explicitly?
i have said yes in one interview but it looks they didnot satisfy with my answer.

please explain with more details... i appreciate your help.
 
Deepak Pant
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your EJB is using container managed transactions then YES you can rollback the transaction either by calling setRollbackOnly() method OR throwing EJBException.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!