Problem:
- Product Name: BES
- Product Version: 6.0 RP1
- Product Component: EJB container
- Platform/OS Version: all
java.sql.SQLException: Cannot invoke getApplicationLevelObject on a connection in state: Free
ERROR - at com.inprise.visitransact.jdbc2.InpriseDataSource.getConnection(InpriseDataSource.java:361)
ERROR - at com.inprise.visitransact.jdbc2.InpriseDataSource.getConnection(InpriseDataSource.java:368)
ERROR - at com.reg.core.db.PoolManager.getConnection(PoolManager.java:45)
Resolution:
This error is caused by inconsistent state of a datasource connection.From the customer"s source code, there are api"s like getConnection(), freeConnection() , rollback(), commit() etc. The application is using purely bean managed transactions, in that case it is mandatory that the freeConnection() should always be called after a commit() or a rollback() is called, if not there is a very high possibility that our connection pools gets into an inconsistent state.
On one hand, bean managed transaction should be avoid unless there is a true need, on the other hand, in bean managed transactions, application should always be using UserTransaction, as opposed to using JDBC transactions. The Container manages the JDBC resources for the application when used within the context of a UserTransaction, and reduces the chance of things to go wrong here.
In summary, the way the application is interacting with the JDBC pool could be the potential cause for this exception, this largely has to do with the way getConnection(), freeConnection(), rollback(), commit() calls are called.
#Security
#VisiBroker




