aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Two connections in one transaction? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Two connections in one transaction?" Watch "Two connections in one transaction?" New topic
Author

Two connections in one transaction?

alex seba
Greenhorn

Joined: Jul 19, 2002
Posts: 12
Hi,
I'm using a stateless Session Bean as a facade to some Entity Beans. All transactions are managed by the container. Within a business method of the Session Bean, is it possible to have access to two connection pools within on transaction? I'm getting a java.sql.SQLException that there cannot be two connections within one transaction, so I'm quite sure there is no way, at least with CMT. But as I don't have too much experience with J2EE I'm posting my question here.
Thanks in advance
Alex
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3879
It should work so long as your Database driver supports XA. Which application server are you using? The way in which you set the database driver up depends on the application server.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
alex seba
Greenhorn

Joined: Jul 19, 2002
Posts: 12
Hi Kyle,
thank you for your answer!
Actually I'm using Weblogic, sometimes JBoss (unfortunately not Websphere...;-)).
And I'm using a DB2 with the COM.ibm.db2.jdbc.app.DB2Driver and an InstantDB with the org.enhydra.instantdb.jdbc.idbDriver.
Any hints how to set up my drivers?
Thanks
Alex
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3879
Nope. You might want to post a more specific question about setting up JTA properties for DB2 drivers in WebLogic in the WebLogic forum.
Kyle
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Two connections in one transaction?
 
Similar Threads
hibernate transaction questions
Two connections in one transaction?
Enthuware question doubt
Entity Bean with CMT question
Stateless beans and SessionSynchronization