• Post Reply Bookmark Topic Watch Topic
  • New Topic

Silly doubt in Exception handling in EJB  RSS feed

 
Veena Sundaram
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a code in EJB which throws RemoteException (I know EJB need not throw RemoteException). I would like to know if the container will roll back the transaction or not.

I have this doubt since RemoteException does not RuntimeException and hence the container might not roll back the transaction.

Please clarify.
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well basically what will happen, is whatever exception that is thrown, it gets wrapped in a RemoteException. It isn't really, so to speak, a RemoteException that was thrown as the root cause, but that is what is passed back to the client. So yes, the transaction should roll back when an exception is thrown.

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