A transaction management engine, such as a business process management
(BPM) engine, can allow an application to define transaction demarcations
in order to ensure that portions of a workflow are processed atomically.
In one such system, a JMS message is queued to the workflow as part of an
existing transaction. If that transaction commits, the queued JMS message
ensures that the workflow will be invoked in a new transaction that
allows the workflow to perform the next unit of work in the newly
initiated transaction. When the unit of work is completed, the workflow
queues another JMS message. If this transaction commits, the transaction
ensures the unit of work has executed in a transaction. When the workflow
is invoked again due to the second JMS message, the workflow can continue
its operation in a different transaction.