[jbossts-issues] [JBoss JIRA] (JBTM-3083) Cannot get delegate of JMSContext during an beforeCompletion synch

Jan-Willem Gmelig Meyling (Jira) issues at jboss.org
Fri Nov 30 07:05:00 EST 2018


     [ https://issues.jboss.org/browse/JBTM-3083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan-Willem Gmelig Meyling updated JBTM-3083:
--------------------------------------------
    Description: 
The {{TransactionContext}} registers a {{TransactionScopeCleanup}} {{Synchronization}} with the active transaction. This prevents a {{TransactionContext}} to be opened from another {{beforeCompletion}} {{Synchronization}}, if the transacted {{JMSContext}} was not interacted with earlier in the transaction. (Because the synchronization cannot be placed)

*Use case*
I have a JPA post insert lifecycle listener that needs to publish an event. I'd like this to happen within the same XA transaction. The lifecycle listener is handled in during the pre-commit flush, itself invoked through another {{beforeCompletion}} transaction  {{Synchronization}}.

*Workaround*
Flush the {{EntityManager}} and don't leave the flushing up to the {{beforeCompletion}} synchronization.

The issue seems also described in the following Stack Overflow issue: https://stackoverflow.com/questions/21523534/jboss-wildfly-arjuna016082-synchronizations-are-not-allowed-when-sending-mess 
(Which refers to WildFly 8.0.0.CR1)

Back in the day, it seemed [~smarlow] suggested that an *interposed* synchronization  should be registered with the {{TransactionSynchronizationRegistry}} instead.

See the attached log for a full stack trace.



  was:
The {{TransactionContext}} registers a {{TransactionScopeCleanup}} {{Synchronization}} with the active transaction. This prevents a {{TransactionContext}} to be opened from another {{beforeCompletion}} {{Synchronization}}, if the transacted {{JMSContext}} was not interacted with earlier in the transaction.

*Use case*
I have a JPA post insert lifecycle listener that needs to publish an event. I'd like this to happen within the same XA transaction. The lifecycle listener is handled in during the pre-commit flush, itself invoked through another {{beforeCompletion}} transaction  {{Synchronization}}.

*Workaround*
Flush the {{EntityManager}} and don't leave the flushing up to the {{beforeCompletion}} synchronization.

The issue seems also described in the following Stack Overflow issue: https://stackoverflow.com/questions/21523534/jboss-wildfly-arjuna016082-synchronizations-are-not-allowed-when-sending-mess 
(Which refers to WildFly 8.0.0.CR1)

Back in the day, it seemed [~smarlow] suggested that an *interposed* synchronization  should be registered with the {{TransactionSynchronizationRegistry}} instead.

See the attached log for a full stack trace.





> Cannot get delegate of JMSContext during an beforeCompletion synch
> ------------------------------------------------------------------
>
>                 Key: JBTM-3083
>                 URL: https://issues.jboss.org/browse/JBTM-3083
>             Project: JBoss Transaction Manager
>          Issue Type: Bug
>         Environment: WildFly 14.0.1.Final, narayana 5.9.0.Final
> WildFly 8.0.0.CR1
>            Reporter: Jan-Willem Gmelig Meyling
>            Priority: Minor
>         Attachments: ARJUNA016082.log
>
>
> The {{TransactionContext}} registers a {{TransactionScopeCleanup}} {{Synchronization}} with the active transaction. This prevents a {{TransactionContext}} to be opened from another {{beforeCompletion}} {{Synchronization}}, if the transacted {{JMSContext}} was not interacted with earlier in the transaction. (Because the synchronization cannot be placed)
> *Use case*
> I have a JPA post insert lifecycle listener that needs to publish an event. I'd like this to happen within the same XA transaction. The lifecycle listener is handled in during the pre-commit flush, itself invoked through another {{beforeCompletion}} transaction  {{Synchronization}}.
> *Workaround*
> Flush the {{EntityManager}} and don't leave the flushing up to the {{beforeCompletion}} synchronization.
> The issue seems also described in the following Stack Overflow issue: https://stackoverflow.com/questions/21523534/jboss-wildfly-arjuna016082-synchronizations-are-not-allowed-when-sending-mess 
> (Which refers to WildFly 8.0.0.CR1)
> Back in the day, it seemed [~smarlow] suggested that an *interposed* synchronization  should be registered with the {{TransactionSynchronizationRegistry}} instead.
> See the attached log for a full stack trace.



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jbossts-issues mailing list