wood burning stoves 2.0*
The moose likes Websphere and the fly likes Db2 driver and Distributed transaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Db2 driver and Distributed transaction" Watch "Db2 driver and Distributed transaction" New topic
Author

Db2 driver and Distributed transaction

Adam Tao
Greenhorn

Joined: Jun 03, 2002
Posts: 24
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 <br /> <br />Sun Certified Enterprise Architect for J2EE<br />IBM Certified for e-business - Solution Designer<br />IBM Certified Advanced System Administrator - WebSphere Application Server V5.0<br />IBM Certified Solution Developer - XML and Related Technologies
Adam Tao
Greenhorn

Joined: Jun 03, 2002
Posts: 24
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

Joined: Mar 05, 2002
Posts: 179
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

Joined: Jun 03, 2002
Posts: 24
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

Joined: Jun 03, 2002
Posts: 24
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
 
subject: Db2 driver and Distributed transaction
 
Similar Threads
Distributed Transaction
EJB transaction
Phantom Read / Garbled Data for WAS 5 to DB2 7 OS390
DB2 700 and 701 - Test Sample
JTA Problem in VAJ 4