// don't wait for ages, has to be set before TX is begun
tm.setTransactionTimeout(TRANSACTION_TIMEOUT_SECONDS);
// this is one component with a TX always begin
TransactionConfig config = new MuleTransactionConfig();
config.setFactory(new XaTransactionFactory());
config.setAction(TransactionConfig.ACTION_ALWAYS_BEGIN);
TransactionTemplate<Void> template = new TransactionTemplate<Void>(config, muleContext);
// and the callee component which should begin new transaction, current must be suspended
final TransactionConfig nestedConfig = new MuleTransactionConfig();
nestedConfig.setFactory(new XaTransactionFactory());
nestedConfig.setAction(TransactionConfig.ACTION_NONE);
// start the call chain
template.execute(new TransactionCallback<Void>()
{