A method, apparatus, system, and signal-bearing medium that, in an
embodiment, identify a component that initiates a transaction in an
application, calculate a set of persistent objects potentially enlisted
by the transaction, and calculate a set of potential operations that the
transaction may perform with respect to each of the potentially enlisted
persistent objects. The transaction is then optimized based on a
configuration, where the configuration is based on the set of potential
operations that the transaction may perform with respect to each of the
potentially enlisted persistent objects. If a single invocation of the
component initiates more than one transaction, actions taken by the set
of persistent objects are collapsed into a collapsed set, and policies
relevant to the collapsed set are associated with a unique task name.