org.compass.gps.device.hibernate
Class HibernateSyncTransactionFactory
java.lang.Object
org.compass.core.transaction.AbstractTransactionFactory
org.compass.gps.device.hibernate.HibernateSyncTransactionFactory
- All Implemented Interfaces:
- TransactionFactory
public class HibernateSyncTransactionFactory
- extends AbstractTransactionFactory
Integrates with Hibernate transaction managemnet abstraction and Compass transactions. Uses Hibernate
support for "context session" including its support for registration of synchronizations with the current
transaction.
Will start a Hibernate transaction of none exists, and will join an existing one if one is already
in progress. If the Hibernate transcation is started by this transaction factory, it will also be committed
by it.
In order to use the transaction factory, it must be configured with Compass, as well as calling
setSessionFactory(org.hibernate.SessionFactory) before the Compass instance is created.
- Author:
- kimchy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HibernateSyncTransactionFactory
public HibernateSyncTransactionFactory()
setSessionFactory
public static void setSessionFactory(SessionFactory sessionFactory)
doConfigure
protected void doConfigure(CompassSettings settings)
- Overrides:
doConfigure in class AbstractTransactionFactory
isWithinExistingTransaction
protected boolean isWithinExistingTransaction(InternalCompassSession session)
throws CompassException
- Specified by:
isWithinExistingTransaction in class AbstractTransactionFactory
- Throws:
CompassException
doBeginTransaction
protected InternalCompassTransaction doBeginTransaction(InternalCompassSession session,
CompassTransaction.TransactionIsolation transactionIsolation)
throws CompassException
- Specified by:
doBeginTransaction in class AbstractTransactionFactory
- Throws:
CompassException
doContinueTransaction
protected InternalCompassTransaction doContinueTransaction(InternalCompassSession session)
throws CompassException
- Specified by:
doContinueTransaction in class AbstractTransactionFactory
- Throws:
CompassException
getTransactionBoundSession
public CompassSession getTransactionBoundSession()
throws CompassException
- Description copied from interface:
TransactionFactory
- Retuns a transaction bound session, or
null if none is found.
- Throws:
CompassException
doBindSessionToTransaction
protected void doBindSessionToTransaction(CompassTransaction tr,
CompassSession session)
throws CompassException
- Specified by:
doBindSessionToTransaction in class AbstractTransactionFactory
- Throws:
CompassException
unbindSessionFromTransaction
public void unbindSessionFromTransaction(Transaction transaction)
getSessionFactory
public SessionFactory getSessionFactory()
Copyright (c) 2004-2008 The Compass Project.