You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2020/11/17 17:08:56 UTC

[tomee-tck] branch master updated: Type and async issue

This is an automated email from the ASF dual-hosted git repository.

jlmonteiro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee-tck.git


The following commit(s) were added to refs/heads/master by this push:
     new 8dfeff8  Type and async issue
8dfeff8 is described below

commit 8dfeff8f4a6848f8545ac0a005a4b837ae1ff4e1
Author: Jean-Louis Monteiro <je...@gmail.com>
AuthorDate: Tue Nov 17 18:06:08 2020 +0100

    Type and async issue
---
 .../openejb/cts/TransactionalWorkaroundLeakGuardValve.java  | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/openejb/cts/TransactionalWorkaroundLeakGuardValve.java b/src/main/java/org/apache/openejb/cts/TransactionalWorkaroundLeakGuardValve.java
index 1073baa..8403897 100644
--- a/src/main/java/org/apache/openejb/cts/TransactionalWorkaroundLeakGuardValve.java
+++ b/src/main/java/org/apache/openejb/cts/TransactionalWorkaroundLeakGuardValve.java
@@ -6,7 +6,6 @@ import org.apache.catalina.valves.ValveBase;
 
 import javax.naming.InitialContext;
 import javax.servlet.ServletException;
-import javax.transaction.Status;
 import javax.transaction.UserTransaction;
 import java.io.IOException;
 
@@ -17,7 +16,7 @@ import java.io.IOException;
 public class TransactionalWorkaroundLeakGuardValve extends ValveBase {
 
     public TransactionalWorkaroundLeakGuardValve() {
-        this(false);
+        this(true);
     }
 
     public TransactionalWorkaroundLeakGuardValve(final boolean asyncSupported) {
@@ -26,14 +25,11 @@ public class TransactionalWorkaroundLeakGuardValve extends ValveBase {
 
     @Override
     public void invoke(final Request request, final Response response) throws IOException, ServletException {
-        if (isAsyncSupported()) {
-            getNext().invoke(request, response);
-            return;
-        }
 
-        // attemps to cleanup the thread if any transaction is started.
+        // attempt to cleanup the thread if any transaction is started.
         try {
-            final UserTransaction userTransaction = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
+            final UserTransaction userTransaction =
+                (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
             userTransaction.rollback();
 
         } catch (final Exception e) {
@@ -43,6 +39,5 @@ public class TransactionalWorkaroundLeakGuardValve extends ValveBase {
             getNext().invoke(request, response);
         }
 
-
     }
 }