• 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

Multiple DataSources

 
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm working with two DataSources from a MySQL database in the same servlet.

Each DataSource is using it's own Connection Pool, currently set at 10 connections each.

First, how do I now what is the optimal number of connections to set for each pool?

Second, would it be bad practice to re-use the same Connection object to connect to the second DataSource without closing the connection to the first? (I'm thinking I might be able to get a little better performance this way).

Regards,

Drew
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You said, "Each DataSource is using it's own Connection Pool, currently set at 10 connections each.".

Then you are asking, "re-use the same connection object to connect to the second DataSource without closing the connection to the first"

Couldn't get you? Why use same connection object? As both type of connections have their own pool.

And about the minimum connections per pool. It depends upon the traffic.
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic