• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!