Transaction
-
public abstract class
Transaction
<C extends TransactionContainer> extends AbstractObservable implements TransactionInterface
Constructors
Methods
execute
-
public final void
execute
() The main transaction execution method.
This method calls the following other internal methods and scheduled jobs stored in the
internal Schedule object
:init
- MakeSchedule
, resolve names to ids, aquire read access.Schedule.runJobs(INIT)
- SeeTransactionStage.INIT
.preCheck
- Load/generateEntityACL
s, check if any updates are to be processed.Schedule.runJobs(PRE_CHECK)
- SeeTransactionStage.PRE_CHECK
.check
- only run the jobs in the CHECK stage, seeTransactionStage.CHECK
.Schedule.runJobs(POST_CHECK)
- SeeTransactionStage.POST_CHECK
.postCheck
- currently, nothing happens here (just there for consistency).preTransaction
- acquire write access (if necessary)Schedule.runJobs(PRE_TRANSACTION)
- SeeTransactionStage.PRE_TRANSACTION
.transaction
: This is typically the main method of a Transaction.Schedule.runJobs(POST_TRANSACTION)
- SeeTransactionStage.POST_TRANSACTION
.postTransaction
- Add success messageswriteHistory
- write the transaction history logscommit
- commit the changesrollBack
: Only in the case of errors - rollback any changes (also file-system changes).cleanUp
: Always - cleanup the transaction (e.g. remove temporary files).notifyObservers(CLEAN_UP)
: Also always - for any jobs that do their own clean-up.
See also:
{@linkTransactionStage}.
getAccessManager
-
public static DatabaseAccessManager
getAccessManager
()
getSchedule
getTimestamp
-
public UTCDateTime
getTimestamp
()
getTransactionBenchmark
-
public TransactionBenchmark
getTransactionBenchmark
()
logHistory
-
public abstract boolean
logHistory
() Return true iff this transaction should be logged in the transaction history logs.
makeSchedule
-
protected void
makeSchedule
() Implementation note: Not called in this class, but may be used by subclasses.
E.g. in
Retrieve
andWriteTransaction
.