Interface TransactionManager
-
- All Superinterfaces:
PersistentSet
,TransactionController
- All Known Implementing Classes:
RAMTransaction
public interface TransactionManager extends TransactionController
The TransactionManager interface provides methods on the transaction needed by an access method implementer, but should not be visible to clients of a TransactionController.- See Also:
TransactionController
-
-
Field Summary
Fields Modifier and Type Field Description static int
LOCK_COMMIT_DURATION
hold lock until end of transaction.static int
LOCK_INSTANT_DURATION
release lock immediately after getting lock.static int
LOCK_MANUAL_DURATION
Allow lock to be released manually prior to end transaction.static int
MODE_NONE
Constant used for the lock_level argument to openConglomerate() and openScan() calls.-
Fields inherited from interface org.apache.derby.iapi.store.access.TransactionController
IS_DEFAULT, IS_KEPT, IS_TEMPORARY, ISOLATION_NOLOCK, ISOLATION_READ_COMMITTED, ISOLATION_READ_COMMITTED_NOHOLDLOCK, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, KEEP_LOCKS, MODE_RECORD, MODE_TABLE, OPEN_CONGLOMERATE, OPEN_CREATED_SORTS, OPEN_SCAN, OPEN_SORT, OPEN_TOTAL, OPENMODE_BASEROW_INSERT_LOCKED, OPENMODE_FOR_LOCK_ONLY, OPENMODE_FORUPDATE, OPENMODE_LOCK_NOWAIT, OPENMODE_LOCK_ROW_NOWAIT, OPENMODE_SECONDARY_LOCKED, OPENMODE_USE_UPDATE_LOCKS, READONLY_TRANSACTION_INITIALIZATION, RELEASE_LOCKS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPostCommitWork(Serviceable work)
Add to the list of post commit work.boolean
checkVersion(int requiredMajorVersion, int requiredMinorVersion, java.lang.String feature)
Check to see if a database has been upgraded to the required level in order to use a store feature.void
closeMe(ScanManager scan)
The ScanManager.close() method has been called on "scan".void
closeMe(ConglomerateController conglom_control)
The ConglomerateController.close() method has been called on "conglom_control".void
closeMe(SortController sort_control)
The SortController.close() method has been called on "sort_control".Conglomerate
findExistingConglomerateFromKey(ContainerKey container_key)
Return existing Conglomerate after doing lookup by ContainerKeyTransactionManager
getInternalTransaction()
Get an Internal transaction.Transaction
getRawStoreXact()
Get the Transaction from the Transaction manager.-
Methods inherited from interface org.apache.derby.iapi.services.property.PersistentSet
getProperties, getProperty, getPropertyDefault, propertyDefaultIsVisible, setProperty, setPropertyDefault
-
Methods inherited from interface org.apache.derby.iapi.store.access.TransactionController
abort, addColumnToConglomerate, anyoneBlocked, commit, commitNoSync, compressConglomerate, conglomerateExists, countOpens, createAndLoadConglomerate, createBackingStoreHashtableFromScan, createConglomerate, createSort, createXATransactionFromLocalTransaction, debugOpened, defragmentConglomerate, destroy, dropConglomerate, dropSort, fetchMaxOnBtree, findConglomid, findContainerid, getAccessManager, getActiveStateTxIdString, getContextManager, getDynamicCompiledConglomInfo, getFileHandler, getLockSpace, getStaticCompiledConglomInfo, getTransactionIdString, getUserCreateConglomPropList, isGlobal, isIdle, isPristine, logAndDo, openCompiledConglomerate, openCompiledScan, openConglomerate, openGroupFetchScan, openScan, openSort, openSortCostController, openSortRowSource, openSortScan, openStoreCost, purgeConglomerate, recreateAndLoadConglomerate, releaseSavePoint, rollbackToSavePoint, setNoLockWait, setSavePoint, startNestedUserTransaction
-
-
-
-
Field Detail
-
MODE_NONE
static final int MODE_NONE
Constant used for the lock_level argument to openConglomerate() and openScan() calls. Pass in MODE_NONE if you want no table or row locks. This is currently only supported from within access.- See Also:
- Constant Field Values
-
LOCK_INSTANT_DURATION
static final int LOCK_INSTANT_DURATION
release lock immediately after getting lock.- See Also:
- Constant Field Values
-
LOCK_COMMIT_DURATION
static final int LOCK_COMMIT_DURATION
hold lock until end of transaction.- See Also:
- Constant Field Values
-
LOCK_MANUAL_DURATION
static final int LOCK_MANUAL_DURATION
Allow lock to be released manually prior to end transaction.- See Also:
- Constant Field Values
-
-
Method Detail
-
addPostCommitWork
void addPostCommitWork(Serviceable work)
Add to the list of post commit work.Add to the list of post commit work that may be processed after this transaction commits. If this transaction aborts, then the post commit work list will be thrown away. No post commit work will be taken out on a rollback to save point.
This routine simply delegates the work to the Rawstore transaction.
- Parameters:
work
- The post commit work to do.
-
checkVersion
boolean checkVersion(int requiredMajorVersion, int requiredMinorVersion, java.lang.String feature) throws StandardException
Check to see if a database has been upgraded to the required level in order to use a store feature.- Parameters:
requiredMajorVersion
- required database Engine major versionrequiredMinorVersion
- required database Engine minor versionfeature
- Non-null to throw an exception, null to return the state of the version match.- Returns:
true
if the database has been upgraded to the required level,false
otherwise.- Throws:
StandardException
- if the database is not at the require version whenfeature
feature is notnull
.
-
closeMe
void closeMe(ScanManager scan)
The ScanManager.close() method has been called on "scan".Take whatever cleanup action is appropriate to a closed scan. It is likely this routine will remove references to the scan object that it was maintaining for cleanup purposes.
-
closeMe
void closeMe(ConglomerateController conglom_control)
The ConglomerateController.close() method has been called on "conglom_control".Take whatever cleanup action is appropriate to a closed conglomerateController. It is likely this routine will remove references to the ConglomerateController object that it was maintaining for cleanup purposes.
-
closeMe
void closeMe(SortController sort_control)
The SortController.close() method has been called on "sort_control".Take whatever cleanup action is appropriate to a closed sortController. It is likely this routine will remove references to the SortController object that it was maintaining for cleanup purposes.
-
getInternalTransaction
TransactionManager getInternalTransaction() throws StandardException
Get an Internal transaction.Start an internal transaction. An internal transaction is a completely separate transaction from the current user transaction. All work done in the internal transaction must be physical (ie. it can be undone physically by the rawstore at the page level, rather than logically undone like btree insert/delete operations). The rawstore guarantee's that in the case of a system failure all open Internal transactions are first undone in reverse order, and then other transactions are undone in reverse order.
Internal transactions are meant to implement operations which, if interupted before completion will cause logical operations like tree searches to fail. This special undo order insures that the state of the tree is restored to a consistent state before any logical undo operation which may need to search the tree is performed.
- Returns:
- The new internal transaction.
- Throws:
StandardException
- Standard exception policy.
-
getRawStoreXact
Transaction getRawStoreXact() throws StandardException
Get the Transaction from the Transaction manager.Access methods often need direct access to the "Transaction" - ie. the raw store transaction, so give access to it.
- Returns:
- The raw store transaction.
- Throws:
StandardException
- Standard exception policy.
-
findExistingConglomerateFromKey
Conglomerate findExistingConglomerateFromKey(ContainerKey container_key) throws StandardException
Return existing Conglomerate after doing lookup by ContainerKeyThrows exception if it can't find a matching conglomerate for the ContainerKey.
- Parameters:
container_key
- container key of target conglomerate.- Returns:
- If successful returns
- Throws:
StandardException
- Standard exception policy.
-
-