Class StandaloneMybatisTransactionContext
- java.lang.Object
-
- org.activiti.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext
-
- All Implemented Interfaces:
TransactionContext
public class StandaloneMybatisTransactionContext extends java.lang.Object implements TransactionContext
-
-
Field Summary
Fields Modifier and Type Field Description protected CommandContextcommandContextprotected java.util.Map<TransactionState,java.util.List<TransactionListener>>stateTransactionListeners
-
Constructor Summary
Constructors Constructor Description StandaloneMybatisTransactionContext(CommandContext commandContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTransactionListener(TransactionState transactionState, TransactionListener transactionListener)voidcommit()protected voidexecuteTransactionListeners(java.util.List<TransactionListener> transactionListeners, CommandContext commandContext)protected voidfireTransactionEvent(TransactionState transactionState, boolean executeInNewContext)Fires the event for the providedTransactionState.protected DbSqlSessiongetDbSqlSession()voidrollback()
-
-
-
Field Detail
-
commandContext
protected CommandContext commandContext
-
stateTransactionListeners
protected java.util.Map<TransactionState,java.util.List<TransactionListener>> stateTransactionListeners
-
-
Constructor Detail
-
StandaloneMybatisTransactionContext
public StandaloneMybatisTransactionContext(CommandContext commandContext)
-
-
Method Detail
-
addTransactionListener
public void addTransactionListener(TransactionState transactionState, TransactionListener transactionListener)
- Specified by:
addTransactionListenerin interfaceTransactionContext
-
commit
public void commit()
- Specified by:
commitin interfaceTransactionContext
-
fireTransactionEvent
protected void fireTransactionEvent(TransactionState transactionState, boolean executeInNewContext)
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 transacation 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(java.util.List<TransactionListener> transactionListeners, CommandContext commandContext)
-
getDbSqlSession
protected DbSqlSession getDbSqlSession()
-
rollback
public void rollback()
- Specified by:
rollbackin interfaceTransactionContext
-
-