JBoss Community

Re: Unable to catch RuntimeException in client EJB

created by Jan Martiska in EJB3 - View the full discussion

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

Start a new discussion in EJB3 at Community