openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1726366 - /openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/event/TransactionalEventNotifier.java
Date Sat, 23 Jan 2016 09:52:03 GMT
Author: struberg
Date: Sat Jan 23 09:52:03 2016
New Revision: 1726366

URL: http://svn.apache.org/viewvc?rev=1726366&view=rev
Log:
OWB-1111 also deliver the AFTER_SUCCESS if there is no active transaction

Modified:
    openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/event/TransactionalEventNotifier.java

Modified: openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/event/TransactionalEventNotifier.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/event/TransactionalEventNotifier.java?rev=1726366&r1=1726365&r2=1726366&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/event/TransactionalEventNotifier.java
(original)
+++ openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/event/TransactionalEventNotifier.java
Sat Jan 23 09:52:03 2016
@@ -83,7 +83,15 @@ public final class TransactionalEventNot
             }
             else if (phase.equals(TransactionPhase.AFTER_SUCCESS))
             {
-                registerEvent(transaction, new AfterCompletionSuccess(observer, event, metadata),
false);
+                if (transaction.getStatus() == Status.STATUS_NO_TRANSACTION)
+                {
+                    // the AFTER_SUCCESS observers only get invoked if the TX succeeds or
if there is no transaction
+                    new AfterCompletionSuccess(observer, event, metadata).notifyObserver();
+                }
+                else
+                {
+                    registerEvent(transaction, new AfterCompletionSuccess(observer, event,
metadata), false);
+                }
             }
             else if (phase.equals(TransactionPhase.AFTER_FAILURE))
             {



Mime
View raw message