• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Distributed Transactions

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Uh, DB2 ships with a distributed JDBC 2.0 XA driver. Why not just use that driver instead?
Kyle
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
DB2XADataSource is Type2 driver and apparaently not supported on HP UX ( the deployment platform)
 
We must storm this mad man's lab and destroy his villanous bomb! Are you with me tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic