wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Getting 2 phase commit exception with SQL server and DB2 datasources.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Getting 2 phase commit exception with SQL server and DB2 datasources.... " Watch "Getting 2 phase commit exception with SQL server and DB2 datasources.... " New topic
Author

Getting 2 phase commit exception with SQL server and DB2 datasources....

Nisha Durga
Greenhorn

Joined: Apr 23, 2008
Posts: 2
Hi, I am using 2 datasources. one for SQL server(XA datasource)and another for DB2(not an XA).

In the particular transaction, our code gets nearly 3 connections using getConnection of XA datasource and 2 connections using DB2 datasource. Getting the following exception when the transaction is about to commit: "An illegal attempt to commit a one phase capable resource with existing two phase capable resources has occurred." Is it required to close all connections before committing?

Could you pls help me out of this problem soon??? Thanks in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41155
    
  45
Welcome to JavaRanch.

What does "nearly 3 connections" mean? 2? 3? Why does the code get more than one connection per datasource inside of a single transaction?

Is it required to close all connections before committing?

If a connection is closed, all pending transactions are rolled back - probably not what you want.

It sounds as if the code is trying to use an XA transaction with a non-XA capable datasource. Can the code get an XA-capable connection for DB2 as well?


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting 2 phase commit exception with SQL server and DB2 datasources....
 
Similar Threads
Transaction: Spring2.x + Hibernate3.0 + Jboss + Multiple Databases
Multiple database
transaction when multiple database connections are open
Clustering Warning Messages
How to use MS SQL and DB2 in the same transaction