[seam-commits] Seam SVN: r14059 - branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/async.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Feb 25 08:24:10 EST 2011


Author: manaRH
Date: 2011-02-25 08:24:10 -0500 (Fri, 25 Feb 2011)
New Revision: 14059

Modified:
   branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/async/Asynchronous.java
   branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/async/AsynchronousInvocation.java
Log:
JBPAPP-5410 - fixed regression causes by previous change in ejb tx synchronization

Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/async/Asynchronous.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/async/Asynchronous.java	2011-02-25 11:39:21 UTC (rev 14058)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/async/Asynchronous.java	2011-02-25 13:24:10 UTC (rev 14059)
@@ -92,20 +92,8 @@
          setup();
          try
          {
-            new Work<Object>()
-            {
-               @Override
-               protected Object work()
-               {
-                  process();
-                  return null;
-               }
-            }.workInTransaction();
+            process();
          }
-         catch (Exception e)
-         {
-            log.error("Exception was thrown in asynchronous processing", e);
-         }
          finally
          {
             cleanup();

Modified: branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/async/AsynchronousInvocation.java
===================================================================
--- branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/async/AsynchronousInvocation.java	2011-02-25 11:39:21 UTC (rev 14058)
+++ branches/enterprise/JBPAPP_5_0/src/main/org/jboss/seam/async/AsynchronousInvocation.java	2011-02-25 13:24:10 UTC (rev 14059)
@@ -7,6 +7,7 @@
 import org.jboss.seam.log.LogProvider;
 import org.jboss.seam.log.Logging;
 import org.jboss.seam.util.Reflections;
+import org.jboss.seam.util.Work;
 
 /**
  * An asynchronous method invocation.
@@ -47,19 +48,35 @@
          @Override
          protected void process()
          {
-            Object target = Component.getInstance(componentName);
-            
-            Method method;
             try
             {
-               method = target.getClass().getMethod(methodName, argTypes);
+               new Work()
+               {
+                  
+                  @Override
+                  protected Object work()
+                  {
+                     Object target = Component.getInstance(componentName);
+                     
+                     Method method;
+                     try
+                     {
+                        method = target.getClass().getMethod(methodName, argTypes);
+                     }
+                     catch (NoSuchMethodException nsme)
+                     {
+                        throw new IllegalStateException(nsme);
+                     }
+                     
+                     Reflections.invokeAndWrap(method, target, args);
+                     return null;
+                  }
+               }.workInTransaction();
             }
-            catch (NoSuchMethodException nsme)
+            catch (Exception e)
             {
-               throw new IllegalStateException(nsme);
+               throw new RuntimeException(e);
             }
-            
-            Reflections.invokeAndWrap(method, target, args);
          }
          
       }.run();



More information about the seam-commits mailing list