{
log.tracef("start(%s, %s)", xid, flags);
if (currentXid != null && flags == XAResource.TMNOFLAGS)
{
throw new LocalXAException("Trying to start a new tx when old is not complete! old: " +
currentXid + ", new " + xid + ", flags " + flags, XAException.XAER_PROTO);
}
if (currentXid == null && flags != XAResource.TMNOFLAGS)
{
throw new LocalXAException("Trying to start a new tx with wrong flags! new " + xid +
", flags " + flags, XAException.XAER_PROTO);
}
if (currentXid == null)
{
try
{
cl.getManagedConnection().getLocalTransaction().begin();
}
catch (ResourceException re)
{
throw new LocalXAException("Error trying to start local tx: ", XAException.XAER_RMERR, re);
}
catch (Throwable t)
{
throw new LocalXAException("Throwable trying to start local transaction!", XAException.XAER_RMERR, t);
}
currentXid = xid;
}
}