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: container-managed transaction & manager_lookup_class
PostPosted: Thu Dec 23, 2004 9:43 am 
Newbie

Joined: Mon Dec 06, 2004 5:51 am
Posts: 8
Location: Istanbul/Turkiye
In 'Hibernate In Action' page 50 (and also in documentation) it is written that:

"Set the factory class for the Hibernate Transaction API to JTA as described earlier, and declare the transaction manager lookup specific to your application server. The lookup strategy is required only if you use the second-level caching system in Hibernate, but it doesn’t hurt to set it even without using the cache."

We understood that it is only necessary to write:
Code:
hibernate.transaction.factory_class = net.sf.hibernate.transaction.JTATransactionFactory

in hibernate.properties file.

But if you write only factory_class property and don't write the name of transactionmanagerlookup class in properties file hibernate JBoss throws an exception which says "Could not find UserTransaction in JNDI". Because default jta.UserTransaction is not applicable to JBoss. According to the code (JTATransactionFactory class) Hibernate cannot find the real usertransaction name if you don't mention it explicitly.

According to these, is this statement true?
If we want to use container-managed transaction demarcation we have to give both transaction.factory_class and transaction.manager_lookup_class.


If it is true there is something wrong in the documentation.


Hibernate version: 2.1.6

_________________
thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 23, 2004 1:45 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You misunderstood it.
If you wish to use JVM-level caching of mutable data in a JTA environment, you must specify a strategy for obtaining the JTA TransactionManager, as this is not standardized for J2EE containers:

hibernate.transaction.manager_lookup_class is required in case of 2nd level caching

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