This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Trouble with JDBC Connection Pooling" Watch "Trouble with JDBC Connection Pooling" New topic
Author

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;

try
{
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" "http://xmlns.oracle.com/ias/dtds/data-sources-9_04.dtd">

<data-sources>
<data-source name="poolDS" class="com.evermind.sql.DriverManagerDataSource"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="RPD"
password="RPD"
url="jdbc racle:thin:@10.118.6.40:1521:hfs"
ejb-location="jdbc/poolds_ejb"
pooled-location="jdbc/poolds_pooled"
source-location="jdbc/poolds_ejb"
wait-timeout="10"
inactivity-timeout="10"
min-connections="10"
max-connect-attempts="3"
connection-retry-interval="1"
xa-location="jdbc/poolds_xa"
location="jdbc/poolds_location" />
</data-sources>

...
</xml>

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Trouble with JDBC Connection Pooling
 
Similar Threads
Error with Orion Server: No DataSource found
Resin DB-pooling + authentication. HELP!
Connect DS with JNDI in JBoss AS
Oracle 9i AS and struts!! Urgent
running out of ManagedConnections available