hanging transaction / exhausted connections
acurvers Oct 21, 2010 3:52 AMHello, I'm maintaining an application on jboss in which the developers decided to put business logic in the front end / jsp's and servlets etc..
also of course to accomplish this the transactions are started and commited in the frontend..
the problem that arrises is that if a unexpected exceptions happens the transaction that is opened in the frontend seems (according to log messages) to hang en never be closed.. then the what happens is that it seems the database connection cannot be used and for some reasen all connections to the database get exhausted almost immediately.. resulting in a application that is not functioning anymore until jboss is restarted..
Since its to much work now to rewrite the whole application.. What i did to overcome is, is enable the older transaction manager..(org.jboss.tm.TransactionManagerService) which has the options:
<attribute name="InterruptThreads">true</attribute>
and
<!-- Force a rollback if another thread is associated with the transaction at commit -->
<mbean code="org.jboss.tm.integrity.FailIncompleteTransaction"
name="jboss:service=TransactionManager,plugin=TransactionIntegrity"/>
so i hoped this would help releasing the connections or close the transaction.. so the application would keep functioning.. but it did not help..
anyone has some idea's how i can fix the problem of connections getting exhausted/ transactions not getting closed ? without refactoring all the code to the ejb backend
Caused by: javax.transaction.RollbackException: Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=inotive01/2172842, BranchQual=, localId=2172842] cannot proceed STATUS_ROLLEDBACK
at org.jboss.resource.connectionmanager.TxConnectionManager.checkTransactionActive(TxConnectionManager.java:282)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.checkTransactionActive(BaseConnectionManager2.java:880)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.checkTransactionActive(WrapperDataSource.java:161)
... 39 more
2010-10-20 20:55:11,416 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not execute query [select ......]
com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.