changeset 8567:9bbce0edd36b

(issue1797) Increase session debug output
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 24 Feb 2015 18:32:18 +0100
parents fe7e9da6312a
children 078b07a94023
files backend/src/main/java/org/dive4elements/river/backend/SessionHolder.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/backend/SessionHolder.java	Tue Feb 24 17:16:14 2015 +0100
+++ b/backend/src/main/java/org/dive4elements/river/backend/SessionHolder.java	Tue Feb 24 18:32:18 2015 +0100
@@ -23,7 +23,9 @@
         new ThreadLocal<Session>() {
             @Override
             protected Session initialValue() {
-                return create();
+                Session session = create();
+                log.debug("Initial session value: " + session.hashCode());
+                return session;
             }
         };
 
@@ -38,16 +40,16 @@
     }
 
     public static Session acquire() {
-        log.debug("acquire");
         Session session = create();
+        log.debug("acquired session: " + session.hashCode());
         HOLDER.set(session);
         return session;
     }
 
     public static void release() {
-        log.debug("release");
         Session session = HOLDER.get();
         if (session != null) {
+            log.debug("releasing session: " + session.hashCode());
             try {
                 if (!session.isOpen()) {
                     /* If this check really works in all cases why does hibernate
@@ -63,6 +65,8 @@
                  */
                 log.error("Exception caught on session close! Session already closed?" + e.getMessage());
             }
+        } else {
+            log.debug("release called on NULL session.");
         }
         HOLDER.remove();
     }

http://dive4elements.wald.intevation.org