FileDocCategorySizeDatePackage
TransactionWrapperImpl.javaAPI DocGlassfish v2 API4587Tue May 22 16:54:28 BST 2007oracle.toplink.essentials.internal.ejb.cmp3.transaction.base

TransactionWrapperImpl

public abstract class TransactionWrapperImpl extends Object

Fields Summary
protected EntityManagerImpl
entityManager
protected RepeatableWriteUnitOfWork
localUOW
protected Object
txnKey
Constructors Summary
public TransactionWrapperImpl(EntityManagerImpl entityManager)

    
    
      
        this.entityManager = entityManager;
    
Methods Summary
public abstract java.lang.ObjectcheckForTransaction(boolean validateExistence)
INTERNAL: This method will be used to check for a transaction and throws exception if none exists. If this methiod returns without exception then a transaction exists. This method must be called before accessing the localUOW.

public voidclear()
INTERNAL: Clears the transactional UnitOfWork

        if (this.localUOW != null){
            // all change sets and cache are cleared
            this.localUOW.clear(true);
        }
    
public oracle.toplink.essentials.internal.sessions.UnitOfWorkImplgetLocalUnitOfWork()

        return localUOW;
    
public abstract oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWorkgetTransactionalUnitOfWork(java.lang.Object transaction)
INTERNAL: THis method is used to get the active UnitOfWork. It is special in that it will return the required RepeatableWriteUnitOfWork required by the EntityManager. Once RepeatableWrite is merged into existing UnitOfWork this code can go away.

param
transaction
return

public abstract voidregisterUnitOfWorkWithTxn(oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl uow)

public voidsetLocalUnitOfWork(oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork uow)

        this.localUOW = uow;
    
public abstract voidsetRollbackOnlyInternal()
Mark the current transaction so that the only possible outcome of the transaction is for the transaction to be rolled back. This is an internal method and if the txn is not active will do nothing

public abstract booleanshouldFlushBeforeQuery(oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl uow)
This method will be called when a query is executed. If changes in the entity manager should be flushed this method should return true