Txn
- Transaction implementationpublic class TransactionScope<Txn>
extends java.lang.Object
TransactionManager
Modifier and Type | Method and Description |
---|---|
void |
attach()
Attach this scope to the current thread, if it has been
detached . |
Transaction |
enter(IsolationLevel level)
Enters a new transaction scope which becomes the active transaction.
|
Transaction |
enterTop(IsolationLevel level)
Enters a new top-level transaction scope which becomes the active
transaction.
|
IsolationLevel |
getIsolationLevel()
Returns the isolation level of the active transaction, or null if there
is no active transaction.
|
java.util.concurrent.locks.Lock |
getLock()
Returns lock used by TransactionScope.
|
Txn |
getTxn()
Returns the implementation for the active transaction, or null if there
is no active transaction.
|
boolean |
isForUpdate()
Returns true if an active transaction exists and it is for update.
|
<S extends Storable> |
register(java.lang.Class<S> type,
Cursor<S> cursor)
Registers the given cursor against the active transaction, allowing it
to be closed on transaction exit or transaction manager close.
|
<S extends Storable> |
unregister(java.lang.Class<S> type,
Cursor<S> cursor)
Unregisters a previously registered cursor.
|
public Transaction enter(IsolationLevel level)
level
- desired isolation level (may be null)java.lang.UnsupportedOperationException
- if isolation level higher than
supported by repositorypublic Transaction enterTop(IsolationLevel level)
level
- desired isolation level (may be null)java.lang.UnsupportedOperationException
- if isolation level higher than
supported by repositorypublic <S extends Storable> void register(java.lang.Class<S> type, Cursor<S> cursor)
public <S extends Storable> void unregister(java.lang.Class<S> type, Cursor<S> cursor)
public java.util.concurrent.locks.Lock getLock()
public Txn getTxn() throws java.lang.Exception
java.lang.Exception
- thrown by createTxn or reuseTxnpublic boolean isForUpdate()
public IsolationLevel getIsolationLevel()
public void attach()
detached
.java.lang.IllegalStateException
- if current thread has a different
transaction already attachedCopyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.