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 interface
Transaction commit listener. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommitListener
(Transaction.CommitListener listener) Add a commit listener for this transaction.void
commit()
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 Id
Gets Session Id of the transaction.default Id
boolean
isActive()
See if this transaction is active or not.boolean
isInvolved
(Id id) See if this Id is involved in this transaction or not.default boolean
isInvolved
(StoredObject object) See if this object is involved in this transaction or not.default void
Log something.default void
Log the current stack trace.default void
logStackTrace
(Throwable error) Log the stack trace of the giver errorvoid
Remove a commit listener for this transaction.void
rollback()
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.
-