KickJava   Java API By Example, From Geeks To Geeks.

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


1 //$Id: TransactionFactory.java,v 1.4 2005/05/04 00:13:27 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 import org.hibernate.engine.SessionFactoryImplementor;
11
12 /**
13  * An abstract factory for <tt>Transaction</tt> instances. Concrete implementations
14  * are specified by <tt>hibernate.transaction.factory_class</tt>.<br>
15  * <br>
16  * Implementors must be threadsafe and should declare a public default constructor.
17  * @see Transaction
18  *
19  * @author Anton van Straaten, Gavin King
20  */

21 public interface TransactionFactory {
22
23     public static interface Context {
24         public SessionFactoryImplementor getFactory();
25         public boolean isOpen();
26
27         public boolean isFlushModeNever();
28         public boolean isFlushBeforeCompletionEnabled();
29         public void managedFlush();
30
31         public boolean shouldAutoClose();
32         public void managedClose();
33     }
34
35     /**
36      * Begin a transaction and return the associated <tt>Transaction</tt> instance.
37      *
38      * @param jdbcContext The jdbc context to which the transaction belongs
39      * @param context The contract regarding the context in which this transaction will operate.
40      * @return Transaction
41      * @throws HibernateException
42      */

43     public Transaction beginTransaction(JDBCContext jdbcContext, Context context) throws HibernateException;
44
45     /**
46      * Configure from the given properties.
47      * @param props
48      * @throws HibernateException
49      */

50     public void configure(Properties JavaDoc props) throws HibernateException;
51     
52     /**
53      * Get the default connection release mode
54      */

55     public ConnectionReleaseMode getDefaultReleaseMode();
56 }
57
58
59
60
61
62
Popular Tags