0 Replies Latest reply on May 3, 2009 12:17 AM by Gregory Nikle

    If tx active @Asynchronous fails

    Gregory Nikle Apprentice

      I use Tomcat 6 with Seam 2.0.1GA with non managed JPA and @Asynchronous

      I've got problem, if transaction fails and I catch exception and serve it, all next executions are blocked and my Asynchronous method stops.

      This happen only if I start transaction. If I throw exception without tx, exception is served and next executions are executed.

      Here is my code:

          public QuartzTriggerHandle scheduleMoves(@Expiration Date when, 
                                                   @IntervalDuration Long interval, 
                                                   @FinalExpiration Date stopTime, 
                                                   Person obj) {     
                synchronized (MovesProcessor.class) {
                     int em = 0;
                    try {
                         for (em = 1; em <= max_worlds; em++) {
                              try {
                                    int a = 2;
                                    int b = 0;
      //throw exception
                                    int c = a/b;
                              } catch (Exception e) {
                                   if (getEM(em).getTransaction().isActive())
                              } finally { closeEM(); }
                       } catch (Exception e) {
              return null;

      Can anybody help me how to fix this, and start next executions.