Package com.storedobject.core
Interface Transaction
- All Known Implementing Classes:
AbstractTransaction,DBTransaction,PseudoTransaction
public interface Transaction
SO transaction interface.
- Author:
- Syam
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceTransaction commit listener. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommitListener(Transaction.CommitListener listener) Add a commit listener for this transaction.voidcommit()Commit the transaction.default StoredObject<T extends StoredObject>
T<T extends StoredObject>
Tget(T object) getError()Gets the current error in Transaction.getId()Gets the Id of this transaction.Gets the TransactionManager associated with this Transaction.default IdGets Session Id of the transaction.default IdbooleanisActive()See if this transaction is active or not.booleanisInvolved(Id id) See if this Id is involved in this transaction or not.default booleanisInvolved(StoredObject object) See if this object is involved in this transaction or not.default voidLog something.default voidLog the current stack trace.default voidlogStackTrace(Throwable error) Log the stack trace of the giver errorvoidRemove a commit listener for this transaction.voidrollback()Rollback the transaction.
-
Method Details
-
addCommitListener
Add a commit listener for this transaction.- Parameters:
listener- Listener
-
removeCommitListener
Remove a commit listener for this transaction.- Parameters:
listener- Listener
-
getError
Exception getError()Gets the current error in Transaction. A transaction that was closed normally (committed) does not return any error.- Returns:
- Error if any, otherwise null.
-
getId
-
getManager
TransactionManager getManager()Gets the TransactionManager associated with this Transaction.- Returns:
- TransactionManager
-
getUserId
-
getSession
-
get
-
get
-
get
-
isInvolved
See if this Id is involved in this transaction or not.- Parameters:
id- Id to be checked.- Returns:
- True if involved.
-
isInvolved
See if this object is involved in this transaction or not.- Parameters:
object- Object to be checked.- Returns:
- True if involved.
-
commit
-
rollback
void rollback()Rollback the transaction. -
isActive
boolean isActive()See if this transaction is active or not.- Returns:
- True if active. False if already committed or rolled back.
-
log
-
logStackTrace
default void logStackTrace()Log the current stack trace. -
logStackTrace
Log the stack trace of the giver error- Parameters:
error- Error.
-