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.
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).
posted 11 years ago
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.