[Jboss-cvs] JBossAS SVN: r56726 - branches/JBoss_4_0_3_SP1_JBAS-3635/server/src/main/org/jboss/jms/asf

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 11 08:11:38 EDT 2006


Author: luc.texier at jboss.com
Date: 2006-09-11 08:11:37 -0400 (Mon, 11 Sep 2006)
New Revision: 56726

Modified:
   branches/JBoss_4_0_3_SP1_JBAS-3635/server/src/main/org/jboss/jms/asf/StdServerSession.java
Log:
JBAS-3635 applied Adrian's proposal

Modified: branches/JBoss_4_0_3_SP1_JBAS-3635/server/src/main/org/jboss/jms/asf/StdServerSession.java
===================================================================
--- branches/JBoss_4_0_3_SP1_JBAS-3635/server/src/main/org/jboss/jms/asf/StdServerSession.java	2006-09-11 11:54:24 UTC (rev 56725)
+++ branches/JBoss_4_0_3_SP1_JBAS-3635/server/src/main/org/jboss/jms/asf/StdServerSession.java	2006-09-11 12:11:37 UTC (rev 56726)
@@ -309,7 +309,7 @@
             }
             else
             {
-               // Use the TM to commit the Tx (assert the correct association) 
+               // 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);
@@ -321,7 +321,7 @@
                      log.trace("Rolling back JMS transaction");
                   // 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.
@@ -347,7 +347,22 @@
                      session.commit();
                   }
                }
-            }            
+               else
+               {
+                  if (trace)
+                     log.trace(StdServerSession.this + " transaction already ended tx=" + trans);
+                  // spend the thread association
+                  tm.suspend();
+
+                  // 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 && serverSessionPool.isTransacted())
+                  {
+                     session.rollback();
+                  }
+               }
+            }
          }
          catch (Exception e)
          {




More information about the jboss-cvs-commits mailing list