Hi Gianni,
Thanks for your reply. But Still I have hard time here.
I have set following in hibernate.properties
hibernate.c3p0.timeout=100
hibernate.connection.autoReconnect=true
hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
hibernate.c3p0.max_statements=10
hibernate.dialect=net.sf.hibernate.dialect.Oracle9Dialect
hibernate.c3p0.max_size=15
hibernate.c3p0.idle_test_period=30
hibernate.c3p0.validate=true
hibernate.c3p0.min_size=1
hibernate.connection.autoReconnectForPools=true
The following in c3p0.properties
c3p0.acquireRetryDelay=1000
c3p0.acquireRetryAttempts=100000
c3p0.breakAfterAcquireFailure=false
c3p0.autoCommitOnClose=true
c3p0.testConnectionOnCheckin=true
My work around is as follows:
After starting up my Server ( JBoss) , I used to unplug my network connection ,which inturn automatically disconnect my application from database server. Then after some time I re-plug the network.
Now, the auto reconnection is not getting.
I got the following exception :
19:11:19,363 INFO [NewPooledConnection] [c3p0] Exceptions occurred while trying
to close a PooledConnection's resources normally.
19:11:19,363 INFO [NewPooledConnection] [c3p0] NewPooledConnection close Except
ion.
java.sql.SQLException: Io exception: Connection reset by peer: socket write erro
r
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:125)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:162)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java
:274)
at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:393)
at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:1
036)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnectio
n.java:405)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnectio
n.java:135)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.destroyResource(C
3P0PooledConnectionPool.java:208)
at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool
.java:634)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre
adPoolAsynchronousRunner.java:368)
19:11:19,378 WARN [BasicResourcePool] Failed to destroy resource: com.mchange.v
2.c3p0.impl.NewPooledConnection@1b90c55
java.sql.SQLException: Some resources failed to close properly while closing com
.mchange.v2.c3p0.impl.NewPooledConnection@1b90c55
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnectio
n.java:418)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnectio
n.java:135)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.destroyResource(C
3P0PooledConnectionPool.java:208)
at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool
.java:634)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre
adPoolAsynchronousRunner.java:368)
19:11:46,784 WARN [BasicResourcePool] BasicResourcePool: An idle resource is br
oken and will be purged.
java.sql.SQLException: Connection is invalid
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.testPooledConnect
ion(C3P0PooledConnectionPool.java:196)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.refurbishIdleReso
urce(C3P0PooledConnectionPool.java:136)
at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTa
sk.run(BasicResourcePool.java:1394)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre
adPoolAsynchronousRunner.java:368)
19:11:46,800 WARN [BasicResourcePool] BasicResourcePool: An idle resource is br
oken and will be purged.
java.sql.SQLException: Connection is invalid
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.testPooledConnect
ion(C3P0PooledConnectionPool.java:196)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.refurbishIdleReso
urce(C3P0PooledConnectionPool.java:136)
at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTa
sk.run(BasicResourcePool.java:1394)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre
adPoolAsynchronousRunner.java:368)
19:11:46,800 WARN [BasicResourcePool] BasicResourcePool: An idle resource is br
oken and will be purged.
java.sql.SQLException: Connection is invalid
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.testPooledConnect
ion(C3P0PooledConnectionPool.java:196)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.refurbishIdleReso
urce(C3P0PooledConnectionPool.java:136)
at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTa
sk.run(BasicResourcePool.java:1394)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre
adPoolAsynchronousRunner.java:368)
19:11:46,816 WARN [BasicResourcePool] BasicResourcePool: An idle resource is br
oken and will be purged.
java.sql.SQLException: Connection is invalid
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.testPooledConnect
ion(C3P0PooledConnectionPool.java:196)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.refurbishIdleReso
urce(C3P0PooledConnectionPool.java:136)
at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTa
sk.run(BasicResourcePool.java:1394)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre
adPoolAsynchronousRunner.java:368)
19:11:46,816 WARN [BasicResourcePool] BasicResourcePool: An idle resource is br
oken and will be purged.
java.sql.SQLException: Connection is invalid
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.testPooledConnect
ion(C3P0PooledConnectionPool.java:196)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.refurbishIdleReso
urce(C3P0PooledConnectionPool.java:136)
at com.mchange.v2.resourcepool.BasicResourcePool$AsyncTestIdleResourceTa
sk.run(BasicResourcePool.java:1394)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Thre
adPoolAsynchronousRunner.java:368)
19:12:06,769 WARN [ThreadPoolAsynchronousRunner] com.mchange.v2.async.ThreadPoo
lAsynchronousRunner$DeadlockDetector@b8f09c -- APPARENT DEADLOCK!!! Creating eme
rgency threads for unassigned pending tasks!
19:12:06,769 WARN [ThreadPoolAsynchronousRunner] com.mchange.v2.async.ThreadPoo
lAsynchronousRunner$DeadlockDetector@b8f09c -- APPARENT DEADLOCK!!! Complete Sta
tus: [num_managed_threads: 3, num_active: 3; activeTasks: com.mchange.v2.resourc
epool.BasicResourcePool$5@1bcb91e (com.mchange.v2.async.ThreadPoolAsynchronousRu
nner$PoolThread-#1), com.mchange.v2.resourcepool.BasicResourcePool$5@11d6176 (co
m.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0), com.mchange.v2.r
esourcepool.BasicResourcePool$5@1e990b4 (com.mchange.v2.async.ThreadPoolAsynchro
nousRunner$PoolThread-#2); pendingTasks: com.mchange.v2.c3p0.stmt.GooGooStatemen
tCache$2@11b1b6d, com.mchange.v2.resourcepool.BasicResourcePool$5@a5bfd5, com.mc
hange.v2.c3p0.stmt.GooGooStatementCache$2@1d56250, com.mchange.v2.c3p0.stmt.GooG
ooStatementCache$2@298bbf, com.mchange.v2.resourcepool.BasicResourcePool$5@195c1
4c, com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@c5a1ea, com.mchang
ge.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0); pendingTasks: com.mchan
ge.v2.resourcepool.BasicResourcePool$AcquireTask@62e21b]
19:13:12,737 WARN [JDBCExceptionReporter] SQL Error: 17002, SQLState: null
19:13:12,737 ERROR [JDBCExceptionReporter] Io exception: Connection reset by pee
r: socket write error
19:13:12,737 WARN [JDBCExceptionReporter] SQL Error: 17002, SQLState: null
19:13:12,737 ERROR [JDBCExceptionReporter] Io exception: Connection reset by pee
r: socket write error
19:13:12,753 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl [Fo
rmatId=257, GlobalId=SHANMUGAM//481, BranchQual=] errorCode=XA_UNKNOWN(0)
org.jboss.resource.connectionmanager.JBossLocalXAException: could not commit loc
al tx; - nested throwable: (org.jboss.resource.JBossResourceException: SQLExcept
ion; - nested throwable: (java.sql.SQLException: Closed Connection))
at org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResou
rce.commit(TxConnectionManager.java:701)
at org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:165
6)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:375)
at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCM
T.java:458)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:326)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
50)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
Please any one help me on this issue.
Thanks in advance.
|