Package org.mycore.backend.jpa
Class MCREntityTransaction
java.lang.Object
org.mycore.backend.jpa.MCREntityTransaction
- All Implemented Interfaces:
MCRPersistenceTransaction
-
Constructor Summary
-
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.
-
Constructor Details
-
MCREntityTransaction
public MCREntityTransaction()
-
-
Method Details
-
isReady
public boolean isReady()Description copied from interface:MCRPersistenceTransaction
preconditions in the backend are met and this instance should be used for transactions- Specified by:
isReady
in interfaceMCRPersistenceTransaction
- Returns:
- true if this instance is ready for transaction handling, e.g. underlaying database is configured
-
begin
public void begin()Description copied from interface:MCRPersistenceTransaction
Start a transaction.- Specified by:
begin
in interfaceMCRPersistenceTransaction
-
commit
public void commit()Description copied from interface:MCRPersistenceTransaction
Commit the current transaction, writing any unflushed changes to the backend.- Specified by:
commit
in interfaceMCRPersistenceTransaction
-
rollback
public void rollback()Description copied from interface:MCRPersistenceTransaction
Roll back the current transaction.- Specified by:
rollback
in interfaceMCRPersistenceTransaction
-
getRollbackOnly
public boolean getRollbackOnly()Description copied from interface:MCRPersistenceTransaction
Determine whether the current transaction has been marked for rollback.- Specified by:
getRollbackOnly
in interfaceMCRPersistenceTransaction
- Returns:
- boolean indicating whether the transaction has been marked for rollback
-
isActive
public boolean isActive()Description copied from interface:MCRPersistenceTransaction
Indicate whether a transaction is in progress.- Specified by:
isActive
in interfaceMCRPersistenceTransaction
- Returns:
- boolean indicating whether transaction is in progress
-