public interface BatchTransactionContextFactory
BatchTransactionContext It
keeps track of the created contexts so that upon mule shutdown, any transactions still active (meaning, transactions that still
hasn't been rolled back or committed) are rolled back automatically to prevent data loss. Implementations of this interface
have to be thread safe| Modifier and Type | Method and Description |
|---|---|
void |
closeAndRollback()
closes this factory meaning that it will not accept requests to create any addiitional
BatchTransactionContexts. |
int |
countOpenTransactions()
For monitoring and testing purposes only
|
BatchTransactionContext |
createTransactionContext(BatchJobInstanceAdapter jobInstance)
Creates and tracks a new
BatchTransactionContext associated
to the given BatchJobInstanceAdapter |
BatchTransactionContext createTransactionContext(BatchJobInstanceAdapter jobInstance)
BatchTransactionContext associated
to the given BatchJobInstanceAdapterjobInstance - a not null BatchJobInstanceAdapterBatchTransactionContextIllegalStateException - if invoked after closeAndRollback() was invokedvoid closeAndRollback()
BatchTransactionContexts. If
createTransactionContext(com.mulesoft.mule.runtime.module.batch.engine.BatchJobInstanceAdapter) is invoked after
this method it will throw IllegalStateException. Any active transactions that hasn't been rolled back or
commit at the moment of invoking this method will be automatically rolled back. This method is thread safe and can be safely
invoked multiple timesint countOpenTransactions()
BatchTransactionContext instances have
been created but not closed yetCopyright © 2006–2022 MuleSoft, Inc.. All rights reserved.