Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.iapi.store.raw.xact
Interface TransactionFactory  view TransactionFactory download TransactionFactory.java

All Superinterfaces:
org.apache.derby.iapi.store.raw.Corruptable

public interface TransactionFactory
extends org.apache.derby.iapi.store.raw.Corruptable

This module is intended to be used only within the RawStore. RawStore functionality is accessed only through the RawStoreFactory interface. The transaction manager is responsible for:


Field Summary
static java.lang.String MODULE
           
 
Method Summary
 void createFinished()
          Database creation finished
 boolean findTransaction(TransactionId id, RawTransaction tran)
          Find a transaction using a transactionId and make the passed in transaction assume the identity and properties of that transaction.
 RawTransaction findUserTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf, org.apache.derby.iapi.services.context.ContextManager contextMgr, java.lang.String transName)
          Find a user transaction within the given raw store and the given contextMgr.
 org.apache.derby.iapi.store.raw.log.LogInstant firstUpdateInstant()
          The first log instant that belongs to a transaction that is still active in the raw store.
 org.apache.derby.iapi.services.locks.LockFactory getLockFactory()
          Get the LockFactory to use with this store.
 org.apache.derby.iapi.store.access.TransactionInfo[] getTransactionInfo()
           
 org.apache.derby.iapi.services.io.Formatable getTransactionTable()
          Return the transaction table so it can get logged with the checkpoint log record.
 java.lang.Object getXAResourceManager()
           
 void handlePreparedXacts(org.apache.derby.iapi.store.raw.RawStoreFactory rsf)
          Run through all prepared transactions known to this factory and restore their state such that they remain after recovery, and can be found and handled by a XA transaction manager.
 boolean noActiveUpdateTransaction()
          Returns true if the transaction factory has no active updating transaction
 void resetTranId()
          Reset any resettable transaction Id
 void rollbackAllTransactions(RawTransaction recoveryTransaction, org.apache.derby.iapi.store.raw.RawStoreFactory rsf)
          Rollback and close all transactions known to this factory using a passed in transaction.
 void setRawStoreFactory(org.apache.derby.iapi.store.raw.RawStoreFactory rsf)
          make Transaction factory aware of which raw store factory it belongs to
 RawTransaction startGlobalTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf, org.apache.derby.iapi.services.context.ContextManager contextMgr, int format_id, byte[] global_id, byte[] branch_id)
          Start a new transaction within the given raw store.
 RawTransaction startInternalTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf, org.apache.derby.iapi.services.context.ContextManager contextMgr)
          Start a new internal transaction within the given raw store.
 RawTransaction startNestedReadOnlyUserTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf, java.lang.Object compatibilitySpace, org.apache.derby.iapi.services.context.ContextManager contextMgr, java.lang.String transName)
          Start a new read only transaction within the given raw store.
 RawTransaction startNestedTopTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf, org.apache.derby.iapi.services.context.ContextManager contextMgr)
          Start a new nested top transaction within the given raw store.
 RawTransaction startNestedUpdateUserTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf, org.apache.derby.iapi.services.context.ContextManager contextMgr, java.lang.String transName)
          Start a new update transaction within the given raw store.
 RawTransaction startTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf, org.apache.derby.iapi.services.context.ContextManager contextMgr, java.lang.String transName)
          Start a new transaction within the given raw store.
 boolean submitPostCommitWork(org.apache.derby.iapi.services.daemon.Serviceable work)
          Submit a post commit work to the post commit daemon.
 void useTransactionTable(org.apache.derby.iapi.services.io.Formatable transactionTable)
          Use this transaction table, which is gotten from a checkpoint operation.
 
Methods inherited from interface org.apache.derby.iapi.store.raw.Corruptable
markCorrupt
 

Field Detail

MODULE

public static final java.lang.String MODULE
See Also:
Constant Field Values
Method Detail

getLockFactory

public org.apache.derby.iapi.services.locks.LockFactory getLockFactory()
Get the LockFactory to use with this store.


getXAResourceManager

public java.lang.Object getXAResourceManager()
                                      throws org.apache.derby.iapi.error.StandardException

startTransaction

public RawTransaction startTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf,
                                       org.apache.derby.iapi.services.context.ContextManager contextMgr,
                                       java.lang.String transName)
                                throws org.apache.derby.iapi.error.StandardException
Start a new transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startTransaction


startNestedReadOnlyUserTransaction

public RawTransaction startNestedReadOnlyUserTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf,
                                                         java.lang.Object compatibilitySpace,
                                                         org.apache.derby.iapi.services.context.ContextManager contextMgr,
                                                         java.lang.String transName)
                                                  throws org.apache.derby.iapi.error.StandardException
Start a new read only transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startNestedTransaction


startNestedUpdateUserTransaction

public RawTransaction startNestedUpdateUserTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf,
                                                       org.apache.derby.iapi.services.context.ContextManager contextMgr,
                                                       java.lang.String transName)
                                                throws org.apache.derby.iapi.error.StandardException
Start a new update transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startNestedTransaction


startGlobalTransaction

public RawTransaction startGlobalTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf,
                                             org.apache.derby.iapi.services.context.ContextManager contextMgr,
                                             int format_id,
                                             byte[] global_id,
                                             byte[] branch_id)
                                      throws org.apache.derby.iapi.error.StandardException
Start a new transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startTransaction


findUserTransaction

public RawTransaction findUserTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf,
                                          org.apache.derby.iapi.services.context.ContextManager contextMgr,
                                          java.lang.String transName)
                                   throws org.apache.derby.iapi.error.StandardException
Find a user transaction within the given raw store and the given contextMgr. If no user transaction exist, then start one with name transName. This method will push a transaction context as described in RawStoreFactory.startTransaction


startNestedTopTransaction

public RawTransaction startNestedTopTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf,
                                                org.apache.derby.iapi.services.context.ContextManager contextMgr)
                                         throws org.apache.derby.iapi.error.StandardException
Start a new nested top transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startNestedTopTransaction


startInternalTransaction

public RawTransaction startInternalTransaction(org.apache.derby.iapi.store.raw.RawStoreFactory rsf,
                                               org.apache.derby.iapi.services.context.ContextManager contextMgr)
                                        throws org.apache.derby.iapi.error.StandardException
Start a new internal transaction within the given raw store. This method will push a transaction context as described in RawStoreFactory.startInternalTransaction


findTransaction

public boolean findTransaction(TransactionId id,
                               RawTransaction tran)
Find a transaction using a transactionId and make the passed in transaction assume the identity and properties of that transaction. Used in recovery only.


resetTranId

public void resetTranId()
                 throws org.apache.derby.iapi.error.StandardException
Reset any resettable transaction Id


firstUpdateInstant

public org.apache.derby.iapi.store.raw.log.LogInstant firstUpdateInstant()
The first log instant that belongs to a transaction that is still active in the raw store. This is the first log record of the longest running transaction at this moment.


handlePreparedXacts

public void handlePreparedXacts(org.apache.derby.iapi.store.raw.RawStoreFactory rsf)
                         throws org.apache.derby.iapi.error.StandardException
Run through all prepared transactions known to this factory and restore their state such that they remain after recovery, and can be found and handled by a XA transaction manager. This includes creating a context manager for each, pushing a xact context, and reclaiming update locks on all data changed by the transaction. Used only in recovery.


rollbackAllTransactions

public void rollbackAllTransactions(RawTransaction recoveryTransaction,
                                    org.apache.derby.iapi.store.raw.RawStoreFactory rsf)
                             throws org.apache.derby.iapi.error.StandardException
Rollback and close all transactions known to this factory using a passed in transaction. Used only in recovery.


submitPostCommitWork

public boolean submitPostCommitWork(org.apache.derby.iapi.services.daemon.Serviceable work)
Submit a post commit work to the post commit daemon. The work is always added to the deamon, regardless of the state it returns.


setRawStoreFactory

public void setRawStoreFactory(org.apache.derby.iapi.store.raw.RawStoreFactory rsf)
                        throws org.apache.derby.iapi.error.StandardException
make Transaction factory aware of which raw store factory it belongs to


noActiveUpdateTransaction

public boolean noActiveUpdateTransaction()
Returns true if the transaction factory has no active updating transaction


createFinished

public void createFinished()
                    throws org.apache.derby.iapi.error.StandardException
Database creation finished


getTransactionTable

public org.apache.derby.iapi.services.io.Formatable getTransactionTable()
Return the transaction table so it can get logged with the checkpoint log record.


useTransactionTable

public void useTransactionTable(org.apache.derby.iapi.services.io.Formatable transactionTable)
                         throws org.apache.derby.iapi.error.StandardException
Use this transaction table, which is gotten from a checkpoint operation. Use ONLY during recovery.


getTransactionInfo

public org.apache.derby.iapi.store.access.TransactionInfo[] getTransactionInfo()