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

Db2 driver and Distributed transaction

 
Adam Tao
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have 3 db2 databases, 1 on OS 390, 1 on AIX, 1 on Windows.
I have tried to use session EJB CMT to manage distributed tranaction. No problem to update UDB on AIX and UDB on Windows in a transaction.
IN VAJ4 datasource configuration, I use JTA database type. No problem to update Db2 on OS 390 when using Standalone JAva Application,
But when I use session EJB CMT to update db2 on OS 390, I get an exception as follow:
Exception is:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
InvalidBeanOStateException(current = DESTROYED, expected = )
What is the problem? Db2 driver problem?
Which Db2 driver should I use? Please advice.
Thanks
Adam
 
Adam Tao
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In WAS4, We can configue DataSource implement class using 2 phase commit protocal, in VAJ4, we can just choose database type as JTA, I am wondering they are same or not.
Please advice.
Thanks
Adam
 
Patrick Finnegan
Ranch Hand
Posts: 179
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to use a DB2 XA driver.
In Websphere this is:
<jdbc-driver action="update" name="db2xadriver">
<implementation-class>COM.ibm.db2.jdbc.DB2XADataSource</implementation-class>
 
Adam Tao
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
In Websphere, I can use a DB2 XA driver:
COM.ibm.db2.jdbc.DB2XADataSource , but in VAJ how to configue it use COM.ibm.db2.jdbc.DB2XADataSource? I just can use database type:JTA.
Thanks
Adam
 
Adam Tao
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I use EJB(Session Bean) to manage distributed transaction by both CMT and BMT.
I have no problem to update AIX and WIN Db2 in a transaction. But when I update OS390 DB2 and AIX/WIN Db2 in a transaction, even I just update OS390 DB2 in a transaction using EJB, at first time, I can see the result of updating OS 390 DB2, but when the program reached ut.commit(); (2 phase commit), I got an Exception :javax.transaction.RollbackException in the program.
at EJB test console I got follow error message:
Exception is:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
com.ibm.ejs.container.UncheckedException: ; nested exception is:
java.lang.IllegalStateException: org.omg.CosTransactions.NoTransaction
When I run the EJB again, when the program reached Statement stmt = conn.createStatement();
I got the Exception as follow:
COM.ibm.db2.jdbc.DB2Exception: [IBM][JDBC Driver] CLI0601E Invalid statement handle or statement is closed. SQLSTATE=S1000
From the error message and exception, I am quite sure the problem is OS 390 does not support 2 phase commit. From the document from IBM, DB2 connector using TCP/IP does not need any configure to support 2 phase commit. Do we need any configuration on DB2 connector? Or What is my problem?
Thanks
adam
[ July 02, 2002: Message edited by: Adam Ttj ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic