{
if (tx == null)
{
final String msg = "Cannot suspend, session is not doing work in a transaction ";
throw new HornetQXAException(XAException.XAER_PROTO, msg);
}
else
{
if (tx.getState() == Transaction.State.SUSPENDED)
{
final String msg = "Cannot suspend, transaction is already suspended " + tx.getXid();
throw new HornetQXAException(XAException.XAER_PROTO, msg);
}
else
{
tx.suspend();