• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Distributed Transactions

 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can anybody suggest here how to do distributed transactions if the driver(JDBC2.0, DB2) doesn't support the same.
currently we are down to manually rollingback and reverting changes
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uh, DB2 ships with a distributed JDBC 2.0 XA driver. Why not just use that driver instead?
Kyle
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm moving this to the JDBC forum. Please continue the discussion there. Thank you
 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have UDB8.1 which comes with net (type3) driver but gives error when i try to dp distributed transaction on Weblogic 7.0 SP2
One more thing- the weblogic documentation says
"With an EJB architecture, it is common for multiple EJBs that are doing database work to be invoked as part of a single transaction. Without XA, the only way for this to work is if all transaction participants use the exact same database connection. WebLogic Server uses the JTS driver and a TxDataSource (with Emulate Two-Phase Commit for non-XA Driver selected) to do this behind the scenes without requiring you to explicitly pass the JDBC connection from EJB to EJB."
Does this mean that even if I have an non-XA driver I can still do distributed transaction if "Emulate Two-Phase Commit for non-XA Driver is selected" in weblogic
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A "Distributed Transaction" is one that either crosses a JVM boundary or involves more than one data source (e.g. both Oracle and DB2, or DB2 and a JMS driver). What the emulation feature in Weblogic is allowing you to do is to allow mutliple EJB's to share the same connection under the covers, which keeps you from having to do a distributed transaction (e.g. by having to deal with two separate DB2 connections).
So, do you really just want to run multiple EJB's on DB2 within the same JVM, or do you have one of the other requirements of a real distributed transaction? This all depends on what you need to do...
Kyle
 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we have transaction that spans to two diff data sources and the net driver we have with DB2 doesn't support this.
whenever we open connection to the 2nd data source in the transaction we get this message
"java.sql.SQLException: Connection has already been created in this tx context for pool named <first pool's name>. Illegal attempt to create connection from another pool: <second pool's name>"
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, let's back up from this a bit. What driver classname are you using? Have you tried COM.ibm.db2.jdbc.DB2XADataSource?
Kyle
 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried COM.ibm.db2.jdbc.net.DB2Driver..
The XADataSource is giving configuration errors with weblogic 7.0 SP2
Gives -java.sql.SQLException: No suitable driver
[ December 16, 2003: Message edited by: Monmohan Singh ]
The exception is thrown even when the DB2java.zip ( which contains this class) is in class path
[ December 16, 2003: Message edited by: Monmohan Singh ]
 
Monmohan Singh
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DB2XADataSource is Type2 driver and apparaently not supported on HP UX ( the deployment platform)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic