Class StandaloneMybatisTransactionContext

java.lang.Object
org.flowable.common.engine.impl.cfg.standalone.StandaloneMybatisTransactionContext
All Implemented Interfaces:
TransactionContext

public class StandaloneMybatisTransactionContext extends Object implements TransactionContext
Author:
Tom Baeyens, Joram Barrez
  • Field Details

  • Constructor Details

    • StandaloneMybatisTransactionContext

      public StandaloneMybatisTransactionContext(CommandContext commandContext)
  • Method Details

    • addTransactionListener

      public void addTransactionListener(TransactionState transactionState, TransactionListener transactionListener)
      Specified by:
      addTransactionListener in interface TransactionContext
    • commit

      public void commit()
      Specified by:
      commit in interface TransactionContext
    • fireTransactionEvent

      protected void fireTransactionEvent(TransactionState transactionState, boolean executeInNewContext)
      Fires the event for the provided TransactionState.
      Parameters:
      transactionState - The TransactionState 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 the TransactionState.COMMITTED event: the transaction is already committed and executing logic in the same context could lead to strange behaviour (for example doing a SqlSession.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 interface TransactionContext