Atomikos Forum

Help needed with the 'Connection pool exhausted' error

I am getting these error when I use 'com.atomikos.jdbc.AtomikosDataSourceBean' for oracle and db2. If a valid connection is idle for more than 8hrs, our firewall will close those connections automatically. So, I need to recreate new connections and fillup the pool and throw away the old invalid ones.


For oracle I use,
<property name="xaDataSourceClassName" value="oracle.jdbc.xa.client.OracleXADataSource"/>

and for db2 I use,
<property name="xaDataSourceClassName" value="com.ibm.db2.jcc.DB2XADataSource"/>


ERRORS and WARNINGS:
--------------------
//for db2
WARN  [atomikos] atomikos connection pool 'pool-1': error creating proxy of connection an AtomikosXAPooledConnection with a SessionHandleState with 0 context(s)
com.ibm.db2.jcc.b.DisconnectException: A communication error has been detected. Communication protocol being used: Reply.fill(). Communication API being used: InputStream.read(). Location where the error was detected: Connection timed out. Communication function detecting the error: *. Protocol specific error codes(s) TCP/IP SOCKETS  DB2ConnectionCorrelator: AC12F30B.AD84.090828133438
        at com.ibm.db2.jcc.c.a.a(a.java:373)
...
....
com.atomikos.jdbc.AtomikosXAPooledConnection.testUnderlyingConnection(AtomikosXAPooledConnection.java:90)


//for oracle
WARN  [atomikos] atomikos connection pool 'pool-2': error while trying to recycle
java.sql.SQLException: Io exception: Connection timed out
...
...
at com.atomikos.jdbc.AtomikosXAPooledConnection.testUnderlyingConnection(AtomikosXAPooledConnection.java:90)


//for both
WARN [atomikos] Connection pool exhausted - try increasing 'maxSize' and/or 'borrowConnectionTimeout' on the DataSourceBean.
ERROR [MyDAOImpl] SQLException in methodName(param1,param2,param3)
com.atomikos.jdbc.AtomikosSQLException: Connection pool exhausted - try increasing 'maxSize' and/or 'borrowConnectionTimeout' on the DataSourceBean.

 at com.atomikos.jdbc.AtomikosSQLException.throwAtomikosSQLException(AtomikosSQLException.java:19)
        at com.atomikos.jdbc.AbstractDataSourceBean.throwAtomikosSQLException(AbstractDataSourceBean.java:58)
        at com.atomikos.jdbc.AbstractDataSourceBean.throwAtomikosSQLException(AbstractDataSourceBean.java:53)
        at com.atomikos.jdbc.AbstractDataSourceBean.getConnection(AbstractDataSourceBean.java:290)
        at com.atomikos.jdbc.AbstractDataSourceBean.getConnection(AbstractDataSourceBean.java:337)
        at my.package.methodName(MyDAOImpl.java:118)



How do I fix these WARNINGs and ERRORs? What are all the attributes/parameters I need?


default82df.html?community.6.86.6
asks us to use 'onExhausted' attribute to 'ON_EXHAUSTED_GROW' or 'ON_EXHAUSTED_BLOCK'!! What's the difference?. Will 'ON_EXHAUSTED_GROW' throw away the bad connections and fillup those spaces with the new valid ones?? Do I have to set these attributes in addition to the 'userid', 'password' properties? Is there any other attributes required to get the valid connections always?


Thanks
Ba Ven Send private email
Tuesday, September 01, 2009
 
 
These are the values:

initializing with [ xaDataSourceClassName=oracle.jdbc.xa.client.OracleXADataSource,
uniqueResourceName=pool-2,
maxPoolSize=5,
minPoolSize=1,
borrowConnectionTimeout=30,
maxIdleTime=60,
reapTimeout=0,
maintenanceInterval=60,
testQuery=select 1 from dual,
xaProperties=[URL=url,user=user_id,password=password] loginTimeout=0]

Do I have to change/add anything to fix the issues?
Ba Ven Send private email
Tuesday, September 01, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics