org.compass.core.transaction
Interface TransactionFactory

All Known Implementing Classes:
AbstractJTATransactionFactory, AbstractTransactionFactory, HibernateSyncTransactionFactory, JTASyncTransactionFactory, LocalTransactionFactory, SpringSyncTransactionFactory, XATransactionFactory

public interface TransactionFactory

Author:
kimchy

Method Summary
 CompassTransaction beginTransaction(InternalCompassSession session, CompassTransaction.TransactionIsolation transactionIsolation)
           
 void configure(Compass compass, CompassSettings settings)
           
 CompassSession getTransactionBoundSession()
          Retuns a transaction bound session, or null if none is found.
 boolean tryJoinExistingTransaction(InternalCompassSession session)
          If there is an outer running existing transaction, try and join it.
 

Method Detail

configure

void configure(Compass compass,
               CompassSettings settings)
               throws CompassException
Throws:
CompassException

beginTransaction

CompassTransaction beginTransaction(InternalCompassSession session,
                                    CompassTransaction.TransactionIsolation transactionIsolation)
                                    throws CompassException
Throws:
CompassException

getTransactionBoundSession

CompassSession getTransactionBoundSession()
                                          throws CompassException
Retuns a transaction bound session, or null if none is found.

Throws:
CompassException

tryJoinExistingTransaction

boolean tryJoinExistingTransaction(InternalCompassSession session)
                                   throws CompassException
If there is an outer running existing transaction, try and join it. This method is called when opening a session and will ease the usage of Compass since there won't be a need to begin a transaction explicitly.

Note, this might end up working as if CompassSession.beginTransaction() was called, commit/rollback will not be called afterwards. Actually, beginTransaction might be called again for the same session.

Throws:
CompassException


Copyright (c) 2004-2008 The Compass Project.