File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Multiple DataSources Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Multiple DataSources" Watch "Multiple DataSources" New topic
Author

Multiple DataSources

Drew Lane
Ranch Hand

Joined: May 13, 2001
Posts: 296
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
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple DataSources