Connection Pool Issues

Issue

Cause

Diagnosis

Resolution

Kernel is not getting started after even if Adeptia services is up and running.

The Kernel is not able to connect to MySql Backend Database and throws the Error
"Cannot create PoolableConnectionFactory (No tables used)"

Diagnosis:
Check the Application log for Kernel ()
2013-11-25 06:32:36 org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (No tables used)
2013-11-25 06:32:36 at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
2013-11-25 06:32:36 at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
2013-11-25 06:32:36 at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
2013-11-25 06:32:36 at com.adeptia.indigo.utils.BackendDatabaseConnection.getBackendConnection(BackendDatabaseConnection.java:73)
2013-11-25 06:32:36 at com.adeptia.indigo.license.LicenseValidator.checkAcceleratorGroupDeployed(LicenseValidator.java:288)
2013-11-25 06:32:36 at com.adeptia.indigo.license.LicenseValidator$3.run(LicenseValidator.java:125)
2013-11-25 06:32:36 at java.lang.Thread.run(Unknown Source)
2013-11-25 06:32:36 Caused by: java.sql.SQLException: No tables used
2013-11-25 06:32:36 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
2013-11-25 06:32:36 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
2013-11-25 06:32:36 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
2013-11-25 06:32:36 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
2013-11-25 06:32:36 at com.mysql.jdbc.Connection.execSQL(Connection.java:3277)
2013-11-25 06:32:36 at com.mysql.jdbc.Connection.execSQL(Connection.java:3206)
2013-11-25 06:32:36 at com.mysql.jdbc.Statement.executeQuery(Statement.java:1232)
2013-11-25 06:32:36 at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
2013-11-25 06:32:36 at org.apache.commons.dbcp.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:658)
2013-11-25 06:32:36 at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1558)
2013-11-25 06:32:36 at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
2013-11-25 06:32:36 ... 6 more
2013-11-25 06:32:36,105 INFO [Enterprise Business Integration Management Suite 6.0 Kernel Thread] kernel com.adeptia.indigo.IndigoKernel.boot(IndigoKernel.java:281) - ||||null|||||null|Registering core mbeans|swtestdip01.test.steelwedge.com|
2013-11-25 06:32:38,100 ERROR [License Validator Thread : Validate Services] storage com.adeptia.indigo.storage.jdo.JdoEntityManager$CustomDatabase.performRetry(JdoEntityManager.java:2784) - ||User||null|||||null|Failed to connect to Backend Database. Performing retries[null]|swtestdip01.test.steelwedge.com|

In order to resolve the issue enable the testOnBorrow and validationQuery property for connection pooling. In server-configure.properties file there is a property "abpm.cluster.testOnBorrow" and "abpm.cluster.validationQuery" which is used to validate connection from the backend database and check if connection pool is available. These will ensure that the connection is active and is not closed.

Sometimes when the SFTP polling is going on we are getting the below error. When we re-run the process its executes normally.

Exception:
java.sql.SQLException: Already closed.

The connection to the backend database has automatically been closed

 

The SQL already closed issue can be resolved by enabling the "testOnBorrow" and "validationQuery" property for connection pooling.These will ensure that the connection is active and is not closed.

Administer > Setup > Application Settings > Update System Properties > Performance Optimization > Backend Database > Backend Connection Pooling

In ‘validationQuery’ field you can provide a simple query to check that the connection that is used to backend is active. Below query can be used:

https://support.adeptia.com/hc/en-us/article_attachments/360016909371/13743745fe13db7abe54267b5b7f2f9daa95696d2e8ffa540d4f0bbd9adfbe8a.png

"APPARENT DEADLOCK" Errors in the Logs

The above issue occurs due to Log Connection Pooling. The pool waits indefinitely (when there are no available connections) for a connection to be returned.

"APPARENT DEADLOCK" errors in the logs:

va:608) - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@5c934917 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks!

2013-04-11 15:44:52,749 WARN [Timer-1] com.mchange.v2.async.ThreadPoolAsynchronousRunner com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run(ThreadPoolAsynchronousRunner.java:624) - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@5c934917 -- APPARENT DEADLOCK!!! Complete Status:

2013-04-11 15:44:52 log4j:ERROR error during logging. INSERT INTO AU_LOG (AU_ID, AU_LOGDATE, AU_PRIO, AU_CAT, AU_THREAD, AU_THROWABLE, AU_LOCATION, AU_USERID, AU_GROUPID, AU_MSG) VALUES ( 136571309275077,'1365713092750', 'WARN', 'com.mchange.v2.async.ThreadPoolAsynchronousRunner', 'Timer-1', '', 'com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector.run(ThreadPoolAsynchronousRunner.java:624)', 'null','null','com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@5c934917 -- APPARENT DEADLOCK!!! Complete Status:

GOTO location ".\AdeptiaSuite-6.0\AdeptiaServer\ServerKernel\etc" and open "server.configure.properties" file. Search for a property named "abpm.logdb.pool.maxWait" of Log Connection Pooling and change its value from -1(indefinitely) to a value in milliseconds say 300000. Refer below image for more details:

https://support.adeptia.com/attachments/token/meucclq96ukbako/?name=Screenshot_1.jpg