-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Could not enlist in transaction on entering meta-aware...
PostPosted: Wed Aug 05, 2009 10:24 am 
Newbie

Joined: Sun Jul 27, 2008 9:16 pm
Posts: 2
Hello all, I'm getting a rather strange exception while using two separate persistence-units (one JTA, one RESOURCE_LOCAL). They are not being used at the same time. The transaction from one should be completed by time the other starts. The two PU's are using different data-sources, pointing at the same database.

Here is the exception:
Code:
23:50:25,938 WARN  [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@2828c0
23:50:25,960 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
23:50:25,960 ERROR [JDBCExceptionReporter] Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:a4f0:4a78c6af:c6 status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 7f000001:a4f0:4a78c6af:c6 status: ActionStatus.ABORT_ONLY >))
23:50:25,975 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
23:50:25,975 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:a4f0:4a78c6af:c6 status: ActionStatus.ABORT_ONLY >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:a4f0:4a78c6af:c6 status: ActionStatus.ABORT_ONLY >)


What I find especially strange is that after that exception occurs once, I can no longer create Transactions from the RESOURCE_LOCAL EntityManager:

Code:
23:51:00,004 ERROR [JDBCTransaction] JDBC commit failed
java.sql.SQLException: You cannot commit during a managed transaction!
   at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:543)
   at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:334)
   at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:170)
   at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:146)
   at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
   at com.n4systems.persistence.Transaction.commit(Transaction.java:39)
       ....


The Stateless EJB's using the JTA EntityManager continue to work correctly. This problem is killing me as for the most part, the two persistence-units work fine in the same container and I'm not sure what's different about the interaction in the spot where it fails.

Environment:
hibernate-3.3.1
hibernate-annotations-3.4.0
hibernate-entitymanager-3.4.0
JBoss-4.2.2GA
jdk-1.5.0_15
mysql-connector-java-5.1.8

Any help would be hugely appreciated.

Thanks
Mark


Top
 Profile  
 
 Post subject: Re: Could not enlist in transaction on entering meta-aware...
PostPosted: Wed Aug 05, 2009 2:49 pm 
Newbie

Joined: Sun Jul 27, 2008 9:16 pm
Posts: 2
Hey all, fixed the problem. It my JBoss datasource configuration was incorrect.

For anyone running into a similar issue: I had both the JTA and the RESOURCE_LOCAL persistence-units configured pointing to local-tx-datasource's. The RESOURCE_LOCAL persistence-unit _MUST_ be on a no-tx-datasource.

For more info: http://www.jboss.org/community/wiki/ConfigDataSources

Thanks
Mark


Top
 Profile  
 
 Post subject: Re: Could not enlist in transaction on entering meta-aware...
PostPosted: Thu Aug 26, 2010 2:51 am 
Newbie

Joined: Thu Aug 26, 2010 2:47 am
Posts: 1
Hello ,

I am facing the same problem . But where is the RESOURCE_LOCAL transaction present for ejb2 and how can I change it .

Do you have any idea. ?

How you change the transaction manager for hiberante in jboss


Top
 Profile  
 
 Post subject: Re: Could not enlist in transaction on entering meta-aware...
PostPosted: Tue Sep 28, 2010 2:28 pm 
Newbie

Joined: Tue Sep 28, 2010 2:23 pm
Posts: 1
Remove the reference to isSpecCompliant

This can be a in the following files
jbossjca-service.xml
transaction-service.xml

This is a badly named setting and should be avoided!!

The result is connections are closed and reopened and transactions span different conections.
Hence the error "Could not enlist in transaction on entering meta-aware object"

See dark comments below about this setting
https://jira.jboss.org/browse/JBAS-1662
http://community.jboss.org/thread/92228?tstart=0


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.