Even though I find the limitation a sensible decision, the choice to fail silently and invoke failure observers for a successful transaction seems unfortunate. What I also find odd is that the after failure handler is invoked immediately (so while still committing), instead of after success. Technically its called too early. I really think it would be better to use interposed (run last) synchronisations instead (http://docs.jboss.org/jbossas/javadoc/7.1.2.Final/javax/transaction/TransactionSynchronizationRegistry.html#registerInterposedSynchronization(javax.transaction.Synchronization), and I feel as if the current spec currently would allow to use interposed JTA synchronisations. I'll submit an issue in the spec issue tracker for this. |