Connection Pool with JNDI issue

F

francan

I am using JNDI Database Connection Pool in Tomcat 6.0.20 to connect
to Oracle RAC:
<Resource name="jdbc/myoracle" auth="Container"
type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:eek:racle:thin:mad:myserver:1521:mysid"
username="joness" password="mypasswrd" maxActive="20" maxIdle="10"
maxWait="-1"/>

It works great except after Tomcat container is restarted. The first
time I view a page after the restart, the web page with JNDI DB
connection pool comes back with message:
"Cannot create PoolableConnectionFactory(IO exception: The network
adaptor could not establish the connection".

The next time I view the page and all other times it works great.
Please advise.
 
L

Lew

I am using JNDI Database Connection Pool in Tomcat 6.0.20 to connect
to Oracle RAC:
<Resource name="jdbc/myoracle" auth="Container"
type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:eek:racle:thin:mad:myserver:1521:mysid"
username="joness" password="mypasswrd" maxActive="20" maxIdle="10"
maxWait="-1"/>

It works great except after Tomcat container is restarted. The first

How are you starting, stopping and restarting Tomcat?
time I view a page after the restart, the web page with JNDI DB
connection pool comes back with message:
"Cannot create PoolableConnectionFactory(IO exception: The network
adaptor could not establish the connection".

Are you using the default pooling (tomcat-dbcp.jar)?
The next time I view the page and all other times it works great.
Please advise.

Perhaps the restart doesn't reset the dbcp pool state the first time?

Maybe the OS didn't release the connection the first time, and the attempt to
reconnect or the reaction to its failure tells the OS to kill the old connection?

A few minutes with Google didn't turn up anything that seems relevant.
 
T

Tom Anderson

I am using JNDI Database Connection Pool in Tomcat 6.0.20 to connect
to Oracle RAC:
<Resource name="jdbc/myoracle" auth="Container"
type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
url="jdbc:eek:racle:thin:mad:myserver:1521:mysid"
username="joness" password="mypasswrd" maxActive="20" maxIdle="10"
maxWait="-1"/>

It works great except after Tomcat container is restarted. The first
time I view a page after the restart, the web page with JNDI DB
connection pool comes back with message:
"Cannot create PoolableConnectionFactory(IO exception: The network
adaptor could not establish the connection".

The next time I view the page and all other times it works great.
Please advise.

Check the Oracle logs.

I wonder if when Tomcat shuts down, the connections aren't being properly
closed on the Oracle side, so it doesn't have any free listeners to hand
out to the new Tomcat instance. Seems a bit unlikely, though. How are you
shutting down Tomcat?

tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top