users@glassfish.java.net

Re: How to get SQLState for exceptions thrown while running CMP in Glassfis

From: <glassfish_at_javadesktop.org>
Date: Fri, 10 Apr 2009 14:26:50 PDT

There are 2 ways you can work around this problem (and the problem is not only in beforeCompletion exceptions but also how any exception reaches the client.

The problem with checking result of the rollback is all the time it takes to rollback a transaction (there is usually no optimization for a rollback) and then you need to guess what exactly had happen (codes differ between databases and might be even between the drivers). If you still prefer to do so, you can use 'flush-at-end-of-method' option (see http://docs.sun.com/app/docs/doc/820-4336/beahv?a=view) and do not wait for the transaction to complete. Otherwise a finder will help you determine instances that might reference your CMP before the remove.

HTH,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

http://forums.java.net/jive/thread.jspa?messageID=341668