Bug 780105 (SOA-2476)

Summary: JCR session does not serve updated data in second and additional reads
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Jiri Pechanec <jpechane>
Component: EDSAssignee: Van Halbert <vhalbert>
Status: CLOSED NOTABUG QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.1.0.ER3   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-2476
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-26 13:35:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jiri Pechanec 2010-10-26 05:43:42 UTC
project_key: SOA

When this code is executed
		Session writeSession = RepositoryReferenceFactory.getRepository("repository").login();
		Session readSession = RepositoryReferenceFactory.getRepository("repository").login();
		
		Node root = writeSession.getRootNode();
		Node n = root;
		for (int j = 0; j < 2; j++) {
			for (int i = 0; i < 10; i++) {
				n = n.addNode("newNode", "nt:unstructured");
			}
			writeSession.save();			
			System.out.println(j + "." + readSession.getNode(n.getPath()));
		}
		
		readSession.logout();
		writeSession.logout();

It prints 0./newNode/newNode/newNode/newNode/newNode/newNode/newNode/newNode/newNode/newNode {jcr:primaryType=nt:unstructured, }

and then throws an exception javax.jcr.PathNotFoundException: Unable to find "{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode"; lowest existing path is "/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode/{}newNode

If the read session is closed and opened between the reads then the data are served correctly. In my opinion if the data are updated in the repository then the session should see the new data.

The issue was verified with in-memory and JPA connectors.

Comment 1 Van Halbert 2010-10-26 12:58:26 UTC
Link: Added: This issue depends MODE-981


Comment 2 Van Halbert 2010-10-26 13:26:31 UTC
In regards to sharing data across sessions, Randall has explained that this is not done automatically, unless you call session.refresh().       This is not the current design based on the engineers understanding of the spec.   

Comment 3 Van Halbert 2010-10-26 13:27:35 UTC
Link: Removed: This issue depends MODE-981 


Comment 4 Van Halbert 2010-10-26 13:35:08 UTC
If this is a major issue,  then this needs to be escalated to get an enhancement in ModeShape.