On failover not able to access database with VIP for sometime- MySQLNonTransientConnectionException
veenaonnet Feb 13, 2014 7:09 AMHi,
I am using jboss7.2 and have configured a datasource in it. It is an HA setup. Datasource is configured with VIP. VIP is always with the active node.
When active node goes down, standby node becomes active and gets the VIP but in the code for sometime I keep on getting db exception. However manually I can access the database by using VIP as a host.
Is it because the connections from the pool are getting used?
Error on rolling transaction back: No operations allowed after connection closed.
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
at sun.reflect.GeneratedConstructorAccessor248.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1205)
at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1197)
at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:4693)
at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:1101)
at org.jboss.jca.adapters.jdbc.WrappedConnection.rollback(WrappedConnection.java:778)
at com.omneon.common.msg.MessageFactory.completeTx(MessageFactory.java:894)
at com.omneon.common.msg.MessageFactory.getJobInQueueBySelector(MessageFactory.java:852)
at com.omneon.common.msg.MessageFactory.consumeMessageFromJobTable(MessageFactory.java:937)
at com.omneon.common.msg.MessageFactory.consumeMessageFromJobTable(MessageFactory.java:909)
at com.omneon.common.msg.MessageFactory.consumeMessage(MessageFactory.java:635)
at com.omneon.dam.msg.QueueMessageManager.run(QueueMessageManager.java:262)
at java.lang.Thread.run(Thread.java:744)
at com.omneon.common.msg.MsfThread.run(MsfThread.java:42)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Datasource configuration:
<datasource jta="true" jndi-name="java:jboss/XYZ"
pool-name="XYZ" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://${db.ip.address}:3306/omneon
</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>com.mysql</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED
</transaction-isolation>
<pool>
<min-pool-size>20</min-pool-size>
<max-pool-size>500</max-pool-size>
</pool>
<security>
<user-name>root</user-name>
<password>omneon</password>
</security>
<validation>
<valid-connection-checker
class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker" />
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<use-fast-fail>false</use-fast-fail>
</validation>
<timeout>
<blocking-timeout-millis>5000</blocking-timeout-millis>
</timeout>
</datasource>
Regards,
Veena