Atomikos Forum |
|
We would like to configure that Atomikos will check DB conection we configure pool in such way:
ds = new AtomikosDataSourceBean(); ds.setUniqueResourceName("OCFDs"); ds.setXaDataSourceClassName("org.postgresql.xa.PGXADataSource"); ds.setTestQuery("SELECT version()"); ds.setMaintenanceInterval(30); dbConfiguration = new Properties(); <here we set password/host/port to DB etc> ds.setXaProperties(dbConfiguration); ds.setPoolSize(50); as you se we set setTestQuery and setMaintenanceInterval but from DB log I do not see any "SELECT version()" every 30s. When we restart database we get information that connection was closed but Atomikos does not recreate DB connection 2010-10-15 11:24:06,432 [TP-Processor1] ERROR pl.carrierex.webservice.authorization.AuthorizationWebServiceImpl (LINE: 119) - getToken: Error during operation, execute roolback: java.lang.reflect.UndeclaredThrowableException at $Proxy74.close(Unknown Source) at com.atomikos.jdbc.AtomikosXAPooledConnection.destroy(AtomikosXAPooledConnection.java:60) ...... Caused by: org.postgresql.util.PSQLException: This connection has been closed. at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:714) at org.postgresql.jdbc2.AbstractJdbc2Connection.clearWarnings(AbstractJdbc2Connection.java:597) at org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$ConnectionHandler.invoke(AbstractJdbc23PooledConnection.java:319) at $Proxy74.close(Unknown Source) ... 58 more ...
the strange thing is that after DB restart we get DB connection on Windows but in Linux there is exception
java.lang.reflect.UndeclaredThrowableException at $Proxy74.close(Unknown Source) at com.atomikos.jdbc.AtomikosXAPooledConnection.destroy(AtomikosXAPooledConnection.java:60) at com.atomikos.datasource.pool.ConnectionPool.borrowConnection(ConnectionPool.java:141) at com.atomikos.jdbc.AbstractDataSourceBean.getConnection(AbstractDataSourceBean.java:289) at com.atomikos.jdbc.AbstractDataSourceBean.getConnection(AbstractDataSourceBean.java:341) and Caused by: org.postgresql.util.PSQLException: This connection has been closed. at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:714) at org.postgresql.jdbc2.AbstractJdbc2Connection.clearWarnings(AbstractJdbc2Connection.java:597) at org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$ConnectionHandler.invoke(AbstractJdbc23PooledConnection.java:319) at $Proxy74.close(Unknown Source)
I've compared logs on windows and linux and on windows I have something like this (I have no idea why on Windows it execute testuery but it does not execute query on Linux):
WARNING: atomikos connection pool 'CRMDs': error creating proxy of connection an AtomikosXAPooledConnection with a SessionHandleState with 0 context(s) com.atomikos.datasource.pool.CreateConnectionException: Error executing testQuery but on Linux: 2010-10-15 15:18:31,697 [TP-Processor1] ERROR pl.carrierex.webservice.authorization.AuthorizationWebServiceImpl (LINE: 119) - getToken: Error during operation, execute roolback: java.lang.reflect.UndeclaredThrowableException at $Proxy74.close(Unknown Source) at com.atomikos.jdbc.AtomikosXAPooledConnection.destroy(AtomikosXAPooledConnection.java:60) at com.atomikos.datasource.pool.ConnectionPool.borrowConnection(ConnectionPool.java:141)
I moved question to new topic
default82df.html?community.6.1860.3 "DB pool does not work on Linux and Postgres" |