tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject [20/50] tomee git commit: dont create a session when not needed
Date Wed, 11 Mar 2015 11:56:36 GMT
dont create a session when not needed


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/867b3288
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/867b3288
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/867b3288

Branch: refs/heads/master
Commit: 867b3288250942e5761a27d75f00ba111da6804a
Parents: 45271fd
Author: Romain Manni-Bucau <rmannibucau@apache.org>
Authored: Thu Mar 5 16:28:19 2015 +0100
Committer: Romain Manni-Bucau <rmannibucau@apache.org>
Committed: Thu Mar 5 16:28:38 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/openejb/cdi/CdiAppContextsService.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/867b3288/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
b/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
index 166a992..2d0598b 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiAppContextsService.java
@@ -150,7 +150,10 @@ public class CdiAppContextsService extends AbstractContextsService implements
Co
         if (rc != null) {
             final HttpServletRequest req = rc.getServletRequest();
             if (req != null) {
-                return req.getSession().getId();
+                final HttpSession session = req.getSession(false);
+                if (session != null) {
+                    return session.getId();
+                }
             }
         }
         return null;


Mime
View raw message