-->
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: Application Managed EM involved in JTA tx's - configuration
PostPosted: Thu Dec 14, 2006 7:19 am 
Newbie

Joined: Tue Feb 14, 2006 6:53 am
Posts: 7
I understand that I can use EM in a JEE 1.4 environment by handling the EM myself. So am I correct in understanding that this then is an Application-managed entity manger?

I want to make use of Container Managed Transactions as provided by my application server. So is this possible with an application managed EM?
(On page 2 of the Hibernate EM document it says that an application managed entity manger can be involved in the current JTA transaction.)

I have the following configuration:
<persistence-unit name="persistence" transaction-type="JTA">
<jta-data-source>java:comp/env/Hiber DataSource</jta-data-source>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>

So if the above is possible, does it mean that the persistence context is associated with the JTA transaction lifecycle as stated in the document?
So when the EM is invoked the persistence context is opened if not already associated with the current JTA tx and the persistence context ends when the JTA tx completes?
OR do you have to propagate the persistence context yourself?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 17, 2006 6:33 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
yes, this is considered an application managed EM
If the em is created when a JTA transaction is already active, then the EM joins the transaction
Otherwise, when the transaction is active you need to call em.joinTransaction()

you still have to close() the EM

_________________
Emmanuel


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.