[jboss-user] [EJB3] - Re: Unable to catch RuntimeException in client EJB

Jan Martiska do-not-reply at jboss.com
Tue Dec 18 04:35:32 EST 2012


Jan Martiska [https://community.jboss.org/people/jmartisk] created the discussion

"Re: Unable to catch RuntimeException in client EJB"

To view the discussion, visit: https://community.jboss.org/message/783835#783835

--------------------------------------------------------------
Oh yeah, I kind of thought so.. I guess you can't catch the exception if it goes from the onPostInsert callback, because that metod is called asynchronously to any of your other invocations - after you finish your EJB call. 
I guess you can either
- try to throw the exception earlier than during commit, for example right from the "save" method?
- use bean-managed transactions and try to do the commit yourself in the end of the "save" method - and if the commit fails, you can parse the exception from it.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/783835#783835]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121218/fad3315c/attachment.html 


More information about the jboss-user mailing list