-->
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.  [ 2 posts ] 
Author Message
 Post subject: Transaction local status NOT_ACTIVE with stand alone JTA
PostPosted: Mon May 07, 2012 10:00 pm 
Beginner
Beginner

Joined: Fri Jan 29, 2010 8:17 pm
Posts: 20
Location: Portland OR
I'm back to being perplexed on how to properly setup a stand alone transaction manager(non EE environment) with Hibernate 4.

Per this other post I made recently that contains my configuration info: viewtopic.php?p=2454363
I've already got a JtaPlatform that returns Atomikos specific transaction managers. This seemed to make everything happy as far as a session always being present if a JTA transaction was started. However, for some reason in 4.x in addition to calling Spring's PlatformTransactionManager.getTransaction() to start a JTA transaction, I also have to call session.beginTransaction() in order for the Hibernate transaction's local status to be ACTIVE. This only became really apparent when using the EntityManager interface instead of Session. EntityManager requires an active transaction, while Session does not. For example AbstractQueryImpl->executeUpdate() throws an exception unless I call session.beginTransaction()

After some debugging it appears clear that Hibernate is aware of the global JTA transaction since in org.hibernate.engine.transaction.internal.jta.JtaTransaction 'isInitiator' is false. If 'isInitiator' is false, shouldn't local status be active? What configuration change do I need to make to ensure that if using a stand alone transaction manager that when JTA transactions are started, the hibernate transaction local state is kept in sync correctly?


Top
 Profile  
 
 Post subject: Re: Transaction local status NOT_ACTIVE with stand alone JTA
PostPosted: Fri Mar 28, 2014 9:48 am 
Newbie

Joined: Fri Mar 28, 2014 9:45 am
Posts: 2
Did you solve that issue? I've got the very same thing in an osgi environment with hibernate 4.3.4.Final.

Best regards,

Alexander.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.