-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: The Network Adapter could not establish the connection
PostPosted: Tue Dec 21, 2010 1:41 pm 
Newbie

Joined: Wed Feb 13, 2008 2:32 pm
Posts: 2
Hi,
I am using c3p0 to manage my connection pool. We are using Sun Java System Application Server Platform Edition 9.0_01 (build b02-p01), with Oracle 10.2g on Solaris 8 and 10 servers. The app server is separated from the dB via a firewall that drops unused session connections longer than 5 minutes. Below is an error that I receive after some time running. The logs indicate the exception continues to occur from that point onward. I have tried adjusting several of the c3p0 configuration parameters (current settings are below), but still receive the exception (below). I cannot seem to reproduce this exception as it doesn't seem to happen on Solaris 10 servers, and the only server I can test with is a Solaris 10 5/09 s10s_u7wos_08 SPARC. If anyone has any insight, I would very much appreciate it.
Thank you,
Anthony


<c3p0-config>

<default-config>

<!-- client will wait up to 30 seconds for a connection -->
<property name="checkoutTimeout">30000</property>

<!-- initially start application with a pool of 10 connections -->
<property name="initialPoolSize">10</property>

<!-- connection pool must always have at least 10 establisthed connections -->
<property name="minPoolSize">10</property>

<!-- allow connection pool to grow up to 100 connections total -->
<property name="maxPoolSize">100</property>

<!-- a connection has a maximum of 30 seconds to live -->
<property name="maxConnectionAge">30</property>

<!-- connections idle for 60 seconds are discarded from pool -->
<property name="maxIdleTime">60</property>

<!-- The number of milliseconds a client calling getConnection() will wait
for a Connection to be checked-in or acquired when the pool is exhausted -->
<property name="checkoutTimeout">60000</property>

<!-- Seconds before c3p0's thread pool will try to interrupt an apparently hung task. -->
<property name="maxAdministrativeTaskTime">100</property>

<!-- Spreads JDBC operations over multiple threads - default is 3. -->
<property name="numHelperThreads">10</property>

</default-config>

</c3p0-config>



[#|2010-12-17T01:55:56.104-0500|WARNING|sun-appserver-pe9.0|com.mchange.v2.resourcepool.BasicResourcePool|_ThreadID=67;_ThreadName=com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#7;_RequestID=456d3703-42ad-432c-95c2-9c28e0912ce0;|com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@ff63cd -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3695)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:352)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:362)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:536)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:328)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
|#]


Top
 Profile  
 
 Post subject: Re: The Network Adapter could not establish the connection
PostPosted: Wed Dec 22, 2010 6:08 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
c3p0 has options to validate the connections, periodically or just before returning the collection to hibernate.
Please read c3p0 manual, or just google for it there is much information about this: http://www.databasesandlife.com/automatic-reconnect-from-hibernate-to-mysql/.

Alternatively, you don't have to use c3p0, there are other connection pools available. The JBoss datasource service has an impressive list of features regarding connection validation and health checks.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.