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 CommandContext
protected DbSqlSession
protected Map<TransactionState,
List<TransactionListener>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTransactionListener
(TransactionState transactionState, TransactionListener transactionListener) void
commit()
protected void
executeTransactionListeners
(List<TransactionListener> transactionListeners, CommandContext commandContext) protected void
fireTransactionEvent
(TransactionState transactionState, boolean executeInNewContext) Fires the event for the providedTransactionState
.void
rollback()
-
Field Details
-
commandContext
-
dbSqlSession
-
stateTransactionListeners
-
-
Constructor Details
-
StandaloneMybatisTransactionContext
-
-
Method Details
-
addTransactionListener
public void addTransactionListener(TransactionState transactionState, TransactionListener transactionListener) - Specified by:
addTransactionListener
in interfaceTransactionContext
-
commit
public void commit()- Specified by:
commit
in interfaceTransactionContext
-
fireTransactionEvent
Fires the event for the providedTransactionState
.- Parameters:
transactionState
- TheTransactionState
for 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.COMMITTED
event: 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:
rollback
in interfaceTransactionContext
-