View Full Version : JTATransactionManager
Patrick Vanhuyse
Aug 20th, 2004, 07:35 AM
I'm looking for examples using JOTM with JTATransactionManager to handle multiple JDBC data sources in one transaction manager.
So I hope to have transactional multiple database access.
Thanks
Juergen Hoeller
Aug 20th, 2004, 08:23 AM
Have a look at the javadoc of org.springframework.transaction.jta.JotmFactoryBea n: It gives a basic example of how to set up JOTM and XADataSources as beans in a Spring context.
Transaction demarcation and data access works as usual then, for example via TransactionProxyFactoryBean (wired with the JtaTransactionManager as set up for JOTM) and DAOs that access either one or both of the DataSources.
Juergen
Patrick Vanhuyse
Aug 23rd, 2004, 09:04 AM
It works.
Thank you.
k07032
Oct 10th, 2005, 05:09 PM
I've looked the reference (org.springframework.transaction.jta.JtaTransactio nManager) and got the general idea of how to setup bean to work with JOTM. However, I still don't know exactly how to setup multiple databases. Do I need another "innerDataSource" bean and "dataSource" bean to specify different driver name and url?
Appreciate any help can give.
Costin Leau
Oct 11th, 2005, 04:02 AM
Search the WIKI - there is an example on how to set a JMS and JDBC datasource which you can apply to your case.
jlawmi
Oct 11th, 2005, 07:23 AM
Not clear if you have jotm working generallly speaking, but this was very valuable for me when trying to use jotm jta:
http://opensource2.atlassian.com/confluence/spring/display/COOK/JTA+++JOTM+usage
For multiple DS, just have both DS definitions use the same transactionManager
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.