KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: JDBCTransactionFactory.java,v 1.4 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.Transaction;
8 import org.hibernate.HibernateException;
9 import org.hibernate.jdbc.JDBCContext;
10
11 /**
12  * Factory for <tt>JDBCTransaction</tt>.
13  * @see JDBCTransaction
14  * @author Anton van Straaten
15  */

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