Package org.frankframework.jta.narayana
Class NarayanaTransactionHelper
java.lang.Object
org.jboss.narayana.jta.jms.TransactionHelperImpl
org.frankframework.jta.narayana.NarayanaTransactionHelper
- All Implemented Interfaces:
org.jboss.narayana.jta.jms.TransactionHelper
public class NarayanaTransactionHelper
extends org.jboss.narayana.jta.jms.TransactionHelperImpl
-
Constructor Summary
ConstructorDescriptionNarayanaTransactionHelper
(jakarta.transaction.TransactionManager transactionManager) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Connections were not always closed, because the super implementation of this method returns false too often.Methods inherited from class org.jboss.narayana.jta.jms.TransactionHelperImpl
deregisterXAResource, registerSynchronization, registerXAResource
-
Constructor Details
-
NarayanaTransactionHelper
public NarayanaTransactionHelper(jakarta.transaction.TransactionManager transactionManager)
-
-
Method Details
-
isTransactionAvailable
public boolean isTransactionAvailable() throws jakarta.jms.JMSExceptionConnections were not always closed, because the super implementation of this method returns false too often.ConnectionProxy.close()
andSessionProxy.close()
both call this method before attempting to close the connection. When the connection is marked asSTATUS_ROLLEDBACK
this method will return true, claiming it's available. This scenario happened when a JMSMessage was marked for rollback by theReaperThread
while being detected as 'stuck' because of a (too) short timeout. While, even though the timeout was too short, no other unexpected behavior was detected. This mechanism however, will prevent the connection from being closed, causing a connection-leak to occur.NOTE: This problem is caused because in the
TransactionImple.getStatus()
theinternal connection status
isconverted
to ajavax.transaction.Status
. Because of the conversion the actual state is lost, andActionStatus.ABORTED
connections are marked asSTATUS_ROLLEDBACK
.- Specified by:
isTransactionAvailable
in interfaceorg.jboss.narayana.jta.jms.TransactionHelper
- Overrides:
isTransactionAvailable
in classorg.jboss.narayana.jta.jms.TransactionHelperImpl
- Throws:
jakarta.jms.JMSException
-