Package org.mycore.common
Interface MCRPersistenceTransaction
- All Known Implementing Classes:
MCREntityTransaction
,MCROCFLPersistenceTransaction
public interface MCRPersistenceTransaction
Thread safety: Implementation must not ensure that concurrent access is without side effects.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
begin()
Start a transaction.void
commit()
Commit the current transaction, writing any unflushed changes to the backend.boolean
Determine whether the current transaction has been marked for rollback.boolean
isActive()
Indicate whether a transaction is in progress.boolean
isReady()
preconditions in the backend are met and this instance should be used for transactionsvoid
rollback()
Roll back the current transaction.
-
Method Details
-
isReady
boolean isReady()preconditions in the backend are met and this instance should be used for transactions- Returns:
- true if this instance is ready for transaction handling, e.g. underlaying database is configured
-
begin
void begin()Start a transaction.- Throws:
IllegalStateException
- ifisActive()
is true
-
commit
void commit()Commit the current transaction, writing any unflushed changes to the backend.- Throws:
IllegalStateException
- ifisActive()
is false
-
rollback
void rollback()Roll back the current transaction.- Throws:
IllegalStateException
- ifisActive()
is false
-
getRollbackOnly
boolean getRollbackOnly()Determine whether the current transaction has been marked for rollback.- Returns:
- boolean indicating whether the transaction has been marked for rollback
- Throws:
IllegalStateException
- ifisActive()
is false
-
isActive
boolean isActive()Indicate whether a transaction is in progress.- Returns:
- boolean indicating whether transaction is in progress
-