This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Is it possible to have connection to two different pools in the same method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Is it possible to have connection to two different pools in the same method?" Watch "Is it possible to have connection to two different pools in the same method?" New topic
Author

Is it possible to have connection to two different pools in the same method?

Neha Monga
Ranch Hand

Joined: Mar 13, 2007
Posts: 34
Hello all,

I am having trouble gaining connection to two different pools in the same method. I need to query two tables which reside in different data sources. The output from one query is the input for the second query. The second query gets executed for as many times as there are rows in the output of first query.

I am getting this exception when trying to access different connection pools using two different connection objects -->

"java.sql.SQLException: Connection has already been created in this tx context for pool named myPool. Illegal attempt to create connection from another pool: ccPool"

Please assist.

Thanks!
Neha M
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

that looks like something specific to your connection pool library. Yes you can, unless your connection pool stops you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it possible to have connection to two different pools in the same method?
 
Similar Threads
Help with closing jdbc connections
Connection Pooling - Urgent
2 databases access with EJB ?
two pools in one transaction
Connection Pooling-Urgent