Error while trying to recover from inactive connection
Hi All,
I am working with non-XA database.
I define two datasource in properties file also I am using property 'testQuery' to check stale connection. But it shows errors for second datasource.
As Bitronix allows a single non-XA database to participate in a XA transaction, I used the property 'automaticEnlistingEnabled' and set it to 'false'.
Below is the error I am getting.
[bitronix.tm.recovery.Recoverer] (bitronix-recovery-thread:) error running recovery on resource 'jdbc/seconddb', resource marked as failed (background recoverer will retry recovery)
bitronix.tm.recovery.RecoveryException: cannot start recovery on a PoolingDataSource containing an XAPool of resource jdbc/seconddb with 30 connection(s) (30 still available)
at bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:227)
at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:253)
at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:223)
at bitronix.tm.recovery.Recoverer.run(Recoverer.java:138)
at java.lang.Thread.run(Thread.java:662)
Caused by: bitronix.tm.internal.BitronixRuntimeException: cannot get valid connection from an XAPool of resource jdbc/seconddb with 30 connection(s) (30 still available) after trying for 30s
at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:156)
at bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:223)
... 4 more
Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
datasource properties.
resource.ds2.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
resource.ds2.uniqueName=jdbc/firstdb
resource.ds2.allowLocalTransactions=true
resource.ds2.driverProperties.driverClassName=com.mysql.jdbc.Driver
resource.ds2.driverProperties.url=jdbc:mysql://localhost:3306/firstdb
resource.ds2.testQuery=SELECT current_timestamp
resource.ds3.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
resource.ds3.uniqueName=jdbc/seconddb
resource.ds3.driverProperties.driverClassName=com.mysql.jdbc.Driver
resource.ds3.driverProperties.url=jdbc:mysql://localhost:3306/seconddb
resource.ds3.allowLocalTransactions=true
resource.ds3.automaticEnlistingEnabled=false
resource.ds3.testQuery=SELECT current_timestamp