Out of curiosity, why not provide a custom JtaPlatform as well?
I did try, but it gets overridden by Hibernate OSGi
Couldn't you also just supply a custom TransactionCoordinator impl and a custom org.hibernate.resource.transaction.spi.TransactionCoordinator.TransactionDriver impl? As far as I can tell that should solve your problem.
That's exactly what I do, and it works almost everywhere. The problem comes when the EntityManager encounters an Exception and tries to mark rollback using this method. The EntityManager is of type JTA (because it needs to integrate with the ongoing transaction) but there isn't a TransactionManager available. If this method used the TransactionDriver instead of the JTAPlatform then I'm sure that it would work. |