1 package org.hibernate.transaction; 2 3 import java.util.Properties ; 4 5 import javax.transaction.TransactionManager ; 6 7 import org.hibernate.HibernateException; 8 9 13 public class JOnASTransactionManagerLookup implements TransactionManagerLookup { 14 15 18 public TransactionManager getTransactionManager(Properties props) throws HibernateException { 19 try { 20 Class clazz = Class.forName("org.objectweb.jonas_tm.Current"); 21 return (TransactionManager ) clazz.getMethod("getTransactionManager", null).invoke(null, null); 22 } 23 catch (Exception e) { 24 throw new HibernateException( "Could not obtain JOnAS transaction manager instance", e ); 25 } 26 } 27 28 public String getUserTransactionName() { 29 return "java:comp/UserTransaction"; 30 } 31 32 } 33 34 | Popular Tags |