[jboss-jira] [JBoss JIRA] (WFLY-3801) Wrong Transaction behaviour for EJBs if JTS is enabled

Tom Jenkinson (JIRA) issues at jboss.org
Wed Oct 22 05:29:35 EDT 2014


    [ https://issues.jboss.org/browse/WFLY-3801?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014148#comment-13014148 ] 

Tom Jenkinson commented on WFLY-3801:
-------------------------------------

Hi guys,

The first thing to note is that this looks like it should be the case regardless of WFLY-3801 so I don't think we should delay closing the issue on account of the WARN.

To the issue at hand. As discussed on the #jbossts forum last night, WARN messages from getStatus provide meaningful information to a user and so disabling them does not make sense. The reason WARNs are printed here for JTS is because getStatus is being called in an "undefined transaction context" (afterCompletion).

I don't think we should go too much further into discussion on this Jira, but I will complete my assessment and then if you want you could raise a forum query discussing getStatus WARNs on the Narayana forum if you like?

Anyway:
	at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:76)
	at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:118)
	at org.hibernate.engine.transaction.internal.jta.CMTTransaction.isActive(CMTTransaction.java:115)
	at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.isTransactionInProgress(TransactionCoordinatorImpl.java:166)
	at org.hibernate.internal.SessionImpl.isTransactionInProgress(SessionImpl.java:462)
	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.isTransactionInProgress(AbstractEntityManagerImpl.java:1504)
	at org.hibernate.jpa.internal.EntityManagerImpl.close(EntityManagerImpl.java:150)
	at org.jboss.as.jpa.transaction.TransactionUtil$SessionSynchronization.afterCompletion(TransactionUtil.java:154)

As you can see getStatus is being called in afterCompletion. We discussed this on the jbossts forum and I can agree that it is spec compliant for JPA sync to call EM.close(). That leaves the question, why is hibernate calling getStatus() in close?

Thanks,
Tom

> Wrong Transaction behaviour for EJBs if JTS is enabled
> ------------------------------------------------------
>
>                 Key: WFLY-3801
>                 URL: https://issues.jboss.org/browse/WFLY-3801
>             Project: WildFly
>          Issue Type: Bug
>          Components: EJB, Transactions
>    Affects Versions: 8.1.0.Final
>         Environment: standalone-full profile with JTS enabled
>            Reporter: Wolf-Dieter Fink
>            Assignee: David Lloyd
>         Attachments: 456a624-withDestroy.log, 8d49872-error.log, enableJTS.cli, reproducer.zip, server.log
>
>
> If JTS is enabled the invocation of EJB's might show a arjuna warning for each method invocation:
>    WARN  [com.arjuna.ats.jts] (RequestProcessor-5) ARJUNA022261: ServerTopLevelAction detected that the transaction was inactive
> This is only the case if other resources are involved, i.e. a DB via JPA.
> If a simple bean is used (like ejb-remote quickstart) this warning is not shown.
> It looks like the transaction is local commited but in case of a SFSB @Remove method the result is a " WFLYEE0006: Failed to destroy component instance  Instance of SFTestBean" and the lifecycle method @PreDestroy is not invoked.



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jboss-jira mailing list