A subordinate transaction exposes an API that allows the prepare and commit/rollback phases of the termination protocol to be driven separately, much like a resource. This maps well to the JCA Terminator API.
However, it poses difficulties for beforeCompletion work. With the current API these must be done at prepare time, but should run in transaction context, which the prepare does not necessarily do. They may also take a long time (e.g. large hibernate context flushes) which can cause timeout issues.
It would be useful to extend the XATerminator so that it exposes the before (and maybe the after, although that's less important) synchronization phases as separate operations. Care should be taken that this does not break usage done though the existing JCA API, which would not allow the new methods to be used directly.