[jboss-jira] [JBoss JIRA] (WFLY-6127) Throw IllegalStateException if JTA tx has an unsynchronized persistence context and the target is synchronized persistence context
Scott Marlow (JIRA)
issues at jboss.org
Thu Feb 4 17:23:00 EST 2016
[ https://issues.jboss.org/browse/WFLY-6127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13159011#comment-13159011 ]
Scott Marlow commented on WFLY-6127:
------------------------------------
https://github.com/scottmarlow/wildfly/tree/WFLY-6127 introduces a EntityManagerWrapper so we can track the SynchronizationType. It might be more efficient to only track the SynchronizationType for persistence contents that are UNSYNCHRONIZED. Previously, we were only checking the SynchronizationType for extended persistence contexts (since we were saving the underlying persistence provider's entity manager in the TransactionSynchronizationRegistry which doesn't expose a getSynchronizationType()).
The downside of the current change is that each transaction scoped persistence context will have an additional Object associated with it (with two Object references to Objects that already exist).
> Throw IllegalStateException if JTA tx has an unsynchronized persistence context and the target is synchronized persistence context
> ----------------------------------------------------------------------------------------------------------------------------------
>
> Key: WFLY-6127
> URL: https://issues.jboss.org/browse/WFLY-6127
> Project: WildFly
> Issue Type: Bug
> Components: JPA / Hibernate
> Affects Versions: 9.0.2.Final
> Reporter: Mazen Mahmoud
> Assignee: Scott Marlow
> Priority: Minor
> Attachments: server-log.txt
>
>
> SPEC: If a component is called and the JTA transaction is propagated into that component:
> If there is a persistence context of type SynchronizationType.UNSYNCHRONIZED
> associated with the JTA transaction and the target component specifies a persistence context of type SynchronizationType.SYNCHRONIZED, the IllegalStateException is thrown by the container
> We have a stateful session bean (SFB1) / PC: TRANSACTION/UNSYNCHRONIZED)
> stateful session bean (SFB2) / PC: TRANSACTION/SYNCHRONIZED)
> SFB1 method M1 (REQUIRED) calls SFB2 Method 2 (REQUIRED):
> PC is propagated from SFB1 to SFB2 without any exception.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list