Magnolia

context: system jcr sessions are not released after a request

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 3.5.4
  • Fix Version/s: 3.5.5, 3.6
  • Component/s: None
  • Labels:
  • Description:
    Hide

    The system repository session is nor released when the user context is released. I did not yet apply the following patch as it has consequences where ever a node reference is kept. An obvious example is the user object which keeps a reference to the user's node.

    Here is the needed patch:

    Index: /Users/philipp/checkout/magnolia/magnolia-core/src/main/java/info/magnolia/context/SystemContextImpl.java
    ===================================================================
    --- /Users/philipp/checkout/magnolia/magnolia-core/src/main/java/info/magnolia/context/SystemContextImpl.java	(revision 14777)
    +++ /Users/philipp/checkout/magnolia/magnolia-core/src/main/java/info/magnolia/context/SystemContextImpl.java	(working copy)
    @@ -87,6 +87,7 @@
         }
     
         public void release() {
    +        super.release();
             repositoryStrategyThreadLocal.set(null);
         }
    Show
    The system repository session is nor released when the user context is released. I did not yet apply the following patch as it has consequences where ever a node reference is kept. An obvious example is the user object which keeps a reference to the user's node. Here is the needed patch:
    Index: /Users/philipp/checkout/magnolia/magnolia-core/src/main/java/info/magnolia/context/SystemContextImpl.java
    ===================================================================
    --- /Users/philipp/checkout/magnolia/magnolia-core/src/main/java/info/magnolia/context/SystemContextImpl.java	(revision 14777)
    +++ /Users/philipp/checkout/magnolia/magnolia-core/src/main/java/info/magnolia/context/SystemContextImpl.java	(working copy)
    @@ -87,6 +87,7 @@
         }
     
         public void release() {
    +        super.release();
             repositoryStrategyThreadLocal.set(null);
         }
  1. MAGNOLIA-2099-3.5.patch
    (23 kB)
    Philipp Bracher [old account - now Philipp Bärfuss]
    23/Apr/08 7:26 PM

Issue Links

Activity

Hide
Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 04/Apr/08 10:46 AM

We should not call super.release() as we only want to close the jcr session but not releasing the access manager

Show
Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 04/Apr/08 10:46 AM We should not call super.release() as we only want to close the jcr session but not releasing the access manager
Hide
Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 23/Apr/08 7:26 PM

This patch contains the major changes I have done on the 3.5 branch. I will apply them on 3.6 and will only commit to 3.5 after they have proven to be robust enough.

I also added an MBean so that one can see the open sessions. On many places we keep a reference to a node (templates, trees, ...) so I had to create a LazyContentWrapper which refetches content if the original session has been closed.

Show
Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 23/Apr/08 7:26 PM This patch contains the major changes I have done on the 3.5 branch. I will apply them on 3.6 and will only commit to 3.5 after they have proven to be robust enough. I also added an MBean so that one can see the open sessions. On many places we keep a reference to a node (templates, trees, ...) so I had to create a LazyContentWrapper which refetches content if the original session has been closed.
Hide
Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 24/Apr/08 5:19 PM

I committed to the trunk (3.6). But now I have realized that this breaks all observation as it is tied to a session.

Perhaps we should go back to the former way of having single sessions for the system context.

Show
Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 24/Apr/08 5:19 PM I committed to the trunk (3.6). But now I have realized that this breaks all observation as it is tied to a session. Perhaps we should go back to the former way of having single sessions for the system context.
Hide
Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 24/Apr/08 5:48 PM

Committed a temporary workaround for the observation (don't logout the sessions which do have listeners registered). Warn logs are written.

It is so sad that I decided to go home ;-(

Show
Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 24/Apr/08 5:48 PM Committed a temporary workaround for the observation (don't logout the sessions which do have listeners registered). Warn logs are written. It is so sad that I decided to go home ;-(
Hide
Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 09/May/08 1:41 PM

I was able to backport the changes to 3.5

Show
Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 09/May/08 1:41 PM I was able to backport the changes to 3.5

People

Dates

  • Created:
    02/Apr/08 5:45 PM
    Updated:
    17/Mar/09 7:48 PM
    Resolved:
    09/May/08 1:41 PM