-
1. Re: Use LastResource Optimization w/ SQL Server JDBC Driver (2.0+)
jhalliday May 27, 2010 9:27 AM (in response to brannic)Stop making life difficult for yourself and use a -ds.xml file like everyone else.
-
2. Re: Use LastResource Optimization w/ SQL Server JDBC Driver (2.0+)
brannic May 27, 2010 9:47 AM (in response to jhalliday)Jonathan,
Believe me I'd like to avoid doing this the hard way if I can. But we actually are defining our connections using -ds.xml files.
For our Oracle connections we are using an oracle-xa-ds.xml file to define our Oracle XA connections.
For our SQL Server connections we are using a sql-ds.xml file which references the JtdsJBossLastResourceDataSource class specified in my first code example to connect to an outbound system. We are trying to see if we can use the same method to switch from jTDS to the Microsoft SQL Server driver to maintain the same level of functionality.
If you like I can post them up here, but to me they seem pretty generic. The only thing which would be changing from most installs is the <driver-class> element.
Thanks for looking at this.
--Rob
-
3. Re: Use LastResource Optimization w/ SQL Server JDBC Driver (2.0+)
jhalliday May 27, 2010 10:07 AM (in response to brannic)Can you explain why using the new MS JDBC driver with a straightforward <local-tx-datasource> and none of this mucking around fails to provide the functionality you need?
-
4. Re: Use LastResource Optimization w/ SQL Server JDBC Driver (2.0+)
brannic May 27, 2010 10:48 AM (in response to jhalliday)Jonathan,
The reason we can't use a regular local-tx-datasource is that we need to ensure that transactions to the Oracle system pass a pre-commit before we commit them to the SQL Server system. If a problem is detected in the Oracle transactions the entire thing is rolled back.
Ideally we could use XA datasources for both the Oracle and the SQL Server databases, but we cannot guarantee that we will have the ability to have the XA components installed on the SQL Server. That's why we are trying to use the Last Resource Optimization strategy.
The solution outlined above is currently working with the jTDS driver. However, I have been instructed to replace jTDS with the Microsoft JDBC Driver as a part of moving to JBoss 5.1.0. Right now I am trying to determine if people have been able to successfully implement the Last Resource optimization using this driver or see if it is even possible.
Thanks,
--Rob
-
5. Re: Use LastResource Optimization w/ SQL Server JDBC Driver (2.0+)
jhalliday May 27, 2010 10:52 AM (in response to brannic)> Right now I am trying to determine if people have been able to successfully implement the Last Resource optimization using this driver or see if it is even possible.
It's possible with any driver. <local-tx-datasource> does it automatically. Stop making your life harder than it needs to be.
"Where a single <local-tx-datasource> is used in a transaction, the LRCO will be automatically applied to it"
-
6. Re: Use LastResource Optimization w/ SQL Server JDBC Driver (2.0+)
brannic May 27, 2010 11:08 AM (in response to jhalliday)Jonathan,
Thank you. I was unaware that using a local-tx-datasource automatically initiated the Last Resource Optimization strategy.
I will give this a try and test it out.
Thanks again for your assistance.
--Rob