This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Neha Monga
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that looks like something specific to your connection pool library. Yes you can, unless your connection pool stops you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic