Class StandaloneMybatisTransactionContext
java.lang.Object
org.flowable.common.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext
- All Implemented Interfaces:
TransactionContext
- Author:
- Tom Baeyens, Joram Barrez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommandContextprotected DbSqlSessionprotected Map<TransactionState,List<TransactionListener>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTransactionListener(TransactionState transactionState, TransactionListener transactionListener) voidcommit()protected voidexecuteTransactionListeners(List<TransactionListener> transactionListeners, CommandContext commandContext) protected voidfireTransactionEvent(TransactionState transactionState, boolean executeInNewContext) Fires the event for the providedTransactionState.voidrollback()
-
Field Details
-
commandContext
-
dbSqlSession
-
stateTransactionListeners
-
-
Constructor Details
-
StandaloneMybatisTransactionContext
-
-
Method Details
-
addTransactionListener
public void addTransactionListener(TransactionState transactionState, TransactionListener transactionListener) - Specified by:
addTransactionListenerin interfaceTransactionContext
-
commit
public void commit()- Specified by:
commitin interfaceTransactionContext
-
fireTransactionEvent
Fires the event for the providedTransactionState.- Parameters:
transactionState- TheTransactionStatefor which the listeners will be called.executeInNewContext- If true, the listeners will be called in a new command context. This is needed for example when firing theTransactionState.COMMITTEDevent: the transaction is already committed and executing logic in the same context could lead to strange behaviour (for example doing aSqlSession.update(String)would actually roll back the update (as the MyBatis context is already committed and the internal flags have not been correctly set).
-
executeTransactionListeners
protected void executeTransactionListeners(List<TransactionListener> transactionListeners, CommandContext commandContext) -
rollback
public void rollback()- Specified by:
rollbackin interfaceTransactionContext
-