-
1. Re: JBossTS+Spring: how to tell TM of DataSource?
dukehoops Feb 16, 2009 7:01 PM (in response to dukehoops)I should add that I read Spring integration wiki (http://www.jboss.org/community/docs/DOC-10805) but found it of little help, since it mentions neither Hibernate nor DataSource.
-
2. Re: JBossTS+Spring: how to tell TM of DataSource?
dukehoops Feb 16, 2009 7:11 PM (in response to dukehoops)Just found this:
http://anonsvn.jboss.org/repos/labs/labs/jbosst/workspace/jhalliday/tomcat-integration/README.txt
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? -
3. Re: JBossTS+Spring: how to tell TM of DataSource?
jhalliday Feb 17, 2009 4:10 AM (in response to dukehoops)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? -
4. Re: JBossTS+Spring: how to tell TM of DataSource?
dukehoops Feb 17, 2009 11:37 AM (in response to dukehoops)I was under (faulty?) impression that mysql provides a single connection (in XA and non-XA) flavors. But what party would pool connections?
-
5. Re: JBossTS+Spring: how to tell TM of DataSource?
dukehoops Feb 17, 2009 1:36 PM (in response to dukehoops)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:
http://forum.springframework.org/showthread.php?p=227251#post227251
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?