KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > transaction > CMTTransactionFactory


1 //$Id: CMTTransactionFactory.java,v 1.2 2005/05/04 00:13:26 oneovthafew Exp $
2
package org.hibernate.transaction;
3
4 import java.util.Properties JavaDoc;
5
6 import org.hibernate.ConnectionReleaseMode;
7 import org.hibernate.HibernateException;
8 import org.hibernate.Transaction;
9 import org.hibernate.jdbc.JDBCContext;
10
11 /**
12  * Factory for <tt>CMTTransaction</tt>.
13  *
14  * @see CMTTransaction
15  * @author Gavin King
16  */

17 public class CMTTransactionFactory implements TransactionFactory {
18
19     public ConnectionReleaseMode getDefaultReleaseMode() {
20         return ConnectionReleaseMode.AFTER_STATEMENT;
21     }
22
23     public void configure(Properties JavaDoc props) throws HibernateException {}
24
25     public Transaction beginTransaction(JDBCContext jdbcContext, Context transactionContext) throws HibernateException {
26         CMTTransaction tx = new CMTTransaction(jdbcContext, transactionContext);
27         tx.begin();
28         return tx;
29     }
30
31 }
32
Popular Tags