FileDocCategorySizeDatePackage
PMTransactionImpl.javaAPI DocGlassfish v2 API4450Fri May 04 22:32:58 BST 2007com.sun.ejb.containers

PMTransactionImpl

public class PMTransactionImpl extends Object implements Transaction
A "wrapper" implementation of javax.transaction.Transaction used by the container to communicate with the PersistenceManager. The PM can only call getStatus, registerSynchronization, setRollbackOnly methods. The Synchronization objects registered by the PM must be called AFTER the Synchronization objects registered by the container, to ensure that all ejbStores are called before the PM flushes state to the database.

Fields Summary
private Transaction
tx
Constructors Summary
PMTransactionImpl(Transaction tx)

	this.tx = tx;
    
Methods Summary
public voidcommit()

        throw new IllegalStateException("Operation not allowed");
    
public booleandelistResource(javax.transaction.xa.XAResource res, int flags)


        throw new IllegalStateException("Operation not allowed");
    
public booleanenlistResource(javax.transaction.xa.XAResource res)


        throw new IllegalStateException("Operation not allowed");
    
public booleanequals(java.lang.Object object)

        if (object == this)
            return true;
        else if ( !(object instanceof PMTransactionImpl) )
            return false;
        else
            return tx.equals(((PMTransactionImpl)object).tx);
    
public intgetStatus()

	return tx.getStatus();
    
public inthashCode()

        return tx.hashCode();
    
public voidregisterSynchronization(javax.transaction.Synchronization pmsync)


	// to make sure ejbStores are called before pmsync.beforeCompletion
	Switch theSwitch = Switch.getSwitch();
	ContainerFactoryImpl cf = (ContainerFactoryImpl)theSwitch.getContainerFactory();
	cf.getContainerSync(tx).addPMSynchronization(pmsync);	
    
public voidrollback()

        
        throw new IllegalStateException("Operation not allowed");
    
public voidsetRollbackOnly()


	tx.setRollbackOnly();