deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject deltaspike git commit: DELTASPIKE-1050 refactored
Date Sat, 30 Jan 2016 10:18:46 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 3a424c771 -> b96a797af


DELTASPIKE-1050 refactored

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

Branch: refs/heads/master
Commit: b96a797af326167b67b4f361867efa20eead5058
Parents: 3a424c7
Author: Thomas Andraschko <tandraschko@apache.org>
Authored: Sat Jan 30 11:18:39 2016 +0100
Committer: Thomas Andraschko <tandraschko@apache.org>
Committed: Sat Jan 30 11:18:39 2016 +0100

----------------------------------------------------------------------
 .../deltaspike/data/impl/handler/EntityManagerRef.java       | 8 ++++++++
 .../apache/deltaspike/data/impl/handler/QueryHandler.java    | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/b96a797a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityManagerRef.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityManagerRef.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityManagerRef.java
index 758be22..8e6dad9 100644
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityManagerRef.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/EntityManagerRef.java
@@ -29,6 +29,14 @@ public class EntityManagerRef
     private EntityManager entityManager;
     private EntityManagerResolver entityManagerResolver;
 
+    public void release()
+    {
+        if (entityManagerResolverDependentProvider != null)
+        {
+            entityManagerResolverDependentProvider.destroy();
+        }
+    }
+
     public Class<? extends EntityManagerResolver> getEntityManagerResolverClass()
     {
         return entityManagerResolverClass;

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/b96a797a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/QueryHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/QueryHandler.java
b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/QueryHandler.java
index 4838cb5..e14bc57 100755
--- a/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/QueryHandler.java
+++ b/deltaspike/modules/data/impl/src/main/java/org/apache/deltaspike/data/impl/handler/QueryHandler.java
@@ -162,9 +162,9 @@ public class QueryHandler implements Serializable, InvocationHandler
         }
         finally
         {
-            if (entityManagerRef != null && entityManagerRef.getEntityManagerResolverDependentProvider()
!= null)
+            if (entityManagerRef != null)
             {
-                entityManagerRef.getEntityManagerResolverDependentProvider().destroy();
+                entityManagerRef.release();
             }
             context.dispose();
         }


Mime
View raw message