Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

2PC - with DB2 8.2 instances from WebSphere  RSS feed

Sam Gehouse
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to do 2 phase commit between 2 different DB2 8.2 databases from a servlet based application deployed in WebSphere 5.1.x.

My code is like:

UserTransaction tx = (UserTransaction) ServerConnector.getContext().lookup("java:comp/UserTransaction");
insertIntoDatabase1(conn); // should throw exception on failure
insertIntoDatabase2(conn); // should throw exception on failure
}catch(Exception e){

insertIntoDatabase1(conn) and insertIntoDatabase2(conn) do NOT thow any exception, meaning the succeed.

However, the line tx.commit() throws the exception below.

I get the exception below:

[5/3/06 14:50:13:708 EDT] 371526c1 XATransaction E J2CA0027E: An exception occurred while invok
ing prepare on an XA Resource Adapter from dataSource dtpra, within transaction ID {XID: format
Id(57415344), gtrid_length(38), bqual_length(28), data(000000000000000200000001322f8fcc37bacf22
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!