[jboss-cvs] JBossAS SVN: r90900 - branches/Branch_5_x/connector/src/main/org/jboss/resource/adapter/jms/inflow.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 7 15:29:42 EDT 2009
Author: jesper.pedersen
Date: 2009-07-07 15:29:42 -0400 (Tue, 07 Jul 2009)
New Revision: 90900
Modified:
branches/Branch_5_x/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsServerSession.java
Log:
do a run with an option A style XA strategy
Modified: branches/Branch_5_x/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsServerSession.java
===================================================================
--- branches/Branch_5_x/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsServerSession.java 2009-07-07 18:38:30 UTC (rev 90899)
+++ branches/Branch_5_x/connector/src/main/org/jboss/resource/adapter/jms/inflow/JmsServerSession.java 2009-07-07 19:29:42 UTC (rev 90900)
@@ -540,8 +540,6 @@
boolean trace = log.isTraceEnabled();
- Transaction trans = null;
-
TransactionManager tm = pool.getActivation().getTransactionManager();;
public XATransactionDemarcationStrategy() throws Throwable
@@ -556,134 +554,14 @@
tm.setTransactionTimeout(timeout);
}
-
- tm.begin();
-
- try
- {
- trans = tm.getTransaction();
-
- if (trace)
- log.trace(JmsServerSession.this + " using tx=" + trans);
-
- if (xaSession != null)
- {
- XAResource res = xaSession.getXAResource();
-
- if (!trans.enlistResource(res))
- {
- throw new JMSException("could not enlist resource");
- }
- if (trace)
- log.trace(JmsServerSession.this + " XAResource '" + res
- + "' enlisted.");
- }
- } catch (Throwable t)
- {
- try
- {
- tm.rollback();
- } catch (Throwable ignored)
- {
- log
- .trace(
- JmsServerSession.this
- + " ignored error rolling back after failed enlist",
- ignored);
- }
- throw t;
- }
-
}
public void error()
{
- // Mark for tollback TX via TM
- try
- {
-
- if (trace)
- log.trace(JmsServerSession.this
- + " using TM to mark TX for rollback tx=" + trans);
- trans.setRollbackOnly();
- } catch (Throwable t)
- {
- log.error(JmsServerSession.this
- + " failed to set rollback only", t);
- }
-
}
public void end()
{
- try
- {
-
- // Use the TM to commit the Tx (assert the correct association)
- Transaction currentTx = tm.getTransaction();
- if (trans.equals(currentTx) == false)
- throw new IllegalStateException(
- "Wrong tx association: expected " + trans + " was "
- + currentTx);
-
- // Marked rollback
- if (trans.getStatus() == Status.STATUS_MARKED_ROLLBACK)
- {
- if (trace)
- log.trace(JmsServerSession.this
- + " rolling back JMS transaction tx=" + trans);
- // actually roll it back
- tm.rollback();
-
- // NO XASession? then manually rollback.
- // This is not so good but
- // it's the best we can do if we have no XASession.
- if (xaSession == null
- && pool.getActivation().isDeliveryTransacted())
- {
- session.rollback();
- }
- }
-
- else if (trans.getStatus() == Status.STATUS_ACTIVE)
- {
- // Commit tx
- // This will happen if
- // a) everything goes well
- // b) app. exception was thrown
- if (trace)
- log.trace(JmsServerSession.this
- + " commiting the JMS transaction tx=" + trans);
- tm.commit();
-
- // NO XASession? then manually commit. This is not so good
- // but
- // it's the best we can do if we have no XASession.
- if (xaSession == null
- && pool.getActivation().isDeliveryTransacted())
- {
- session.commit();
- }
-
- } else
- {
- tm.suspend();
-
- if (xaSession == null
- && pool.getActivation().isDeliveryTransacted())
- {
- session.rollback();
- }
-
- }
-
- } catch (Throwable t)
- {
- log.error(JmsServerSession.this + " failed to commit/rollback",
- t);
- }
-
}
-
}
}
\ No newline at end of file
More information about the jboss-cvs-commits
mailing list