Issue Details (XML | Word | Printable)

Key: MAGNOLIA-2099
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Philipp Bärfuss
Reporter: Philipp Bärfuss
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Magnolia

context: system jcr sessions are not released after a request

Created: 02/Apr/08 05:45 PM   Updated: 17/Mar/09 07:48 PM
Component/s: None
Affects Version/s: 3.5.4
Fix Version/s: 3.5.5, 3.6

Time Tracking:
Not Specified

File Attachments: 1. Text File MAGNOLIA-2099-3.5.patch (23 kB)

Issue Links:
dependency
 

Labels:
Resolution Date: 09/May/08 01:41 PM
Date of First Response: 04/Apr/08 10:46 AM


 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);
     }


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
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

Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 23/Apr/08 07: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.


Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 24/Apr/08 05: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.


Philipp Bracher [old account - now Philipp Bärfuss] added a comment - 24/Apr/08 05: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 ;-(


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