Just found this:
Given That I am using Spring's JtaTransactionManager (which calls commit/rollback/begin on UserTransaction) and a non-XA C3P0 pool, i think the following applies to my situation:
But I want transactions without proper XA.
However, there is a third group: regular, non-XA connections that you want to commit/rollback via
UserTransaction. This model provides ease of use in apps that require multiple databases but don't
actually need the transactional guarantees that two phase commit provides.
If this wrapper still does not exist, I am happy to write it. But how do I pass it to the TransactionManager?
The paragraph you replaced with ... is actually critical:
Right now db connections fall into two groups: the ones from tomcat's regular, non-transaction
aware datasources, on which you must call begin/commit/rollback directly though the Connection,
plus XA aware ones from a db driver's XADataSource via the TransactionalResourceFactory,
which participate in XA transaction automatically and are committed or rolled back via UserTransaction.
C3PO falls into the first group - it does not work with XA.
Given that MySQL does (more or less) support XA, why are you going for the LRCO approach rather than using it properly?
I was under (faulty?) impression that mysql provides a single connection (in XA and non-XA) flavors. But what party would pool connections?
OK, I configured Spring to use MySQL's XADataSource. But I am not seeing any 'commit' calls to DB server ;-
My full travails are documented here:
But I suspect the problem lies in the way I am configuring Spring's JtaTransactionManager and Hibernate Session Factory. However I wonder:
-inside Spring's JtaTransactionManager.doBegin() method there is getUserTransaction().begin(). Should that not be followed by txManager.getTransaction().enlistResource(XAConnection.getXAResource())?
Or is mere usage of XAConnection() by Hibernate's Session enough to (somehow?) have JBossTS manager to enlist that connection?