FileDocCategorySizeDatePackage
TransactionManagerLookupFactory.javaAPI DocHibernate 3.2.51782Sun Apr 15 07:52:46 BST 2007org.hibernate.transaction

TransactionManagerLookupFactory

public final class TransactionManagerLookupFactory extends Object
author
Gavin King

Fields Summary
private static final Log
log
Constructors Summary
private TransactionManagerLookupFactory()


	  
Methods Summary
public static final javax.transaction.TransactionManagergetTransactionManager(java.util.Properties props)

		log.info("obtaining TransactionManager");
		return getTransactionManagerLookup(props).getTransactionManager(props);
	
public static final TransactionManagerLookupgetTransactionManagerLookup(java.util.Properties props)


		String tmLookupClass = props.getProperty(Environment.TRANSACTION_MANAGER_STRATEGY);
		if (tmLookupClass==null) {
			log.info("No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)");
			return null;
		}
		else {

			log.info("instantiating TransactionManagerLookup: " + tmLookupClass);

			try {
				TransactionManagerLookup lookup = (TransactionManagerLookup) ReflectHelper.classForName(tmLookupClass).newInstance();
				log.info("instantiated TransactionManagerLookup");
				return lookup;
			}
			catch (Exception e) {
				log.error("Could not instantiate TransactionManagerLookup", e);
				throw new HibernateException("Could not instantiate TransactionManagerLookup '" + tmLookupClass + "'");
			}
		}