|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.amazon.carbonado.txn.TransactionManager<Txn>
Txn - Transaction implementationpublic abstract class TransactionManager<Txn>
Generic transaction manager for repositories.
| Constructor Summary | |
|---|---|
TransactionManager()
|
|
| Method Summary | |
|---|---|
protected abstract void |
abortTxn(Txn txn)
Aborts and closes the given internal transaction. |
void |
close(boolean suspend)
Closes all transaction scopes. |
protected abstract boolean |
commitTxn(Txn txn)
Commits and closes the given internal transaction. |
protected abstract Txn |
createTxn(Txn parent,
IsolationLevel level)
Creates an internal transaction representation, with the optional parent transaction. |
protected Txn |
createTxn(Txn parent,
IsolationLevel level,
int timeout,
TimeUnit unit)
Creates an internal transaction representation, with the optional parent transaction. |
TransactionScope<Txn> |
detachLocalScope()
Detaches the thread-local TransactionScope from the current thread. |
TransactionScope<Txn> |
localScope()
Returns the thread-local TransactionScope, creating it if needed. |
protected void |
reuseTxn(Txn txn)
Called when a transaction is about to be reused. |
protected abstract IsolationLevel |
selectIsolationLevel(Transaction parent,
IsolationLevel level)
Returns supported isolation level, which may be higher. |
protected void |
setForUpdate(Txn txn,
boolean forUpdate)
Called when the Transaction.setForUpdate method is called. |
protected abstract boolean |
supportsForUpdate()
Return true if transactions support "for update" mode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransactionManager()
| Method Detail |
|---|
public TransactionScope<Txn> localScope()
public TransactionScope<Txn> detachLocalScope()
attached later, and to any thread
which does not currently have a TransactionScope.
public void close(boolean suspend)
throws RepositoryException
suspend - when true, indefinitely suspend all threads interacting
with transactions
RepositoryException
protected abstract IsolationLevel selectIsolationLevel(Transaction parent,
IsolationLevel level)
parent - optional parent transactionlevel - desired isolation level (may be null)protected abstract boolean supportsForUpdate()
protected abstract Txn createTxn(Txn parent,
IsolationLevel level)
throws Exception
parent - optional parent transactionlevel - required isolation level
Exception
protected Txn createTxn(Txn parent,
IsolationLevel level,
int timeout,
TimeUnit unit)
throws Exception
The default implementation of this method just calls the regular createTxn method, ignoring the timeout parameter.
parent - optional parent transactionlevel - required isolation leveltimeout - desired timeout for lock acquisition, never negativeunit - timeout unit, never null
Exception
protected void reuseTxn(Txn txn)
throws Exception
txn - transaction to reuse, never null
Exception
protected void setForUpdate(Txn txn,
boolean forUpdate)
protected abstract boolean commitTxn(Txn txn)
throws PersistException
PersistException
protected abstract void abortTxn(Txn txn)
throws PersistException
PersistException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||