users@glassfish.java.net

Re: global transaction boundary

From: Pawel Veselov <pawel.veselov_at_gmail.com>
Date: Tue, 15 Oct 2013 11:51:44 -0700

On Tue, Oct 15, 2013 at 10:51 AM, Pawel Veselov <pawel.veselov_at_gmail.com>wrote:

> Hi.
>
>
> [skipped]

> Is there a way to tell GlassFish to never automatically manage XA
> connections from any given XA pool, and let application explicitly commit
> or roll it back in all cases?
>
>
>

Reading the source, it doesn't look like it's possible. I'm not sure this
is correct, but JTA spec is not exact on this subject. J2EEInstanceListener
calls TransactionManager.rollback() unconditionally (as long as there is a
present transaction) at the end of any "top level invocation". This happens
before the request listeners are invoked, but after all the
application-level filters.

So my solution, is to move the finalization code into a filter, and make
sure this filter is invoked first, and on any request.