File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Oracle/OAS and the fly likes Trouble with JDBC Connection Pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Trouble with JDBC Connection Pooling" Watch "Trouble with JDBC Connection Pooling" New topic

Trouble with JDBC Connection Pooling

Harish Verma
Ranch Hand

Joined: Feb 27, 2006
Posts: 32
I am trying to enable connection pooling for our application. I am working in the JDev Ide (10g Release 2 10.1.2).

What I am seeing is that the maximum pool size of 5 is reached within no time, after only a few links are clicked, and I end up with timeout errors thrown by the pool. The application requests and releases connections like this:

DAOManager dao = DAOManagerImpl.getInstance();
Connection conn = dao.getConnection();

Within DAOManagerImpl:

public Connection getConnection() throws SQLException, NamingException
Connection connection = null;

DataSource dataSource = ServiceLocator.getInstance().getDataSource("jdbc/XADS_ejb");

connection = dataSource.getConnection();
catch(Exception ex)
//Do something.

return connection;

Here's the data-sources.xml:

<?xml version="1.0" standalone='yes'?>
<!DOCTYPE data-sources PUBLIC "Orion data-sources" "">

<data-source name="poolDS" class="com.evermind.sql.DriverManagerDataSource"
url="jdbc racle:thin:@"
location="jdbc/poolds_location" />


SO what is happening? Why are connections not being released to the pool after the work is over? I tried with 25 as the max-connections value but that quickly got filled up, too.

If the pool is set up properly, I should never get a timeout error in my case where I am the only user issuing database requests. So what am I doing wrong? Any insight / info is most welcome and appreciated. TIA.
I agree. Here's the link:
subject: Trouble with JDBC Connection Pooling
It's not a secret anymore!