Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
Turing Sprint 160
Description
The following scenario currently has a problem:
1) Add a new single valued property (say 'foo') to a jcr node that can contain residual single valued properties and residual multi-valued properties
2) Safe step (1) with session 1
3) Read in the property with session 2 and assert:
assertFalse(session2.getNode("...").getProperty("foo").isMultiple()); assertFalse(session2.getNode("...").getProperty("foo").getDefinition().isMultiple());
4) With session 1, remove property 'foo'
5) with session 1, add property 'foo' as multiple String
6) save session 1
7) Read in the property with session 1 and assert:
assertTrue(session1.getNode("...").getProperty("foo").isMultiple()); assertTrue(session1.getNode("...").getProperty("foo").getDefinition().isMultiple());
The above works.
8) Read in the property with session 2 and assert:
assertTrue(session2.getNode("...").getProperty("foo").isMultiple()); assertTrue(session2.getNode("...").getProperty("foo").getDefinition().isMultiple());
Above, the second assert fails.
Note that refreshing the session does not fix it. It stays broken. A delay (say thread sleep 100 ms) doesn't help either! A new session (session 3) does pass the assertions. It is really only session 2 that has a broken property definition
The above fails because the PropertyImpl in JR contains
public PropertyDefinition getDefinition() throws RepositoryException { // check state of this instance sanityCheck(); return data.getPropertyDefinition(); }
and 'data' is the same ItemDate object. The code in there is:
public ItemDefinition getDefinition() throws RepositoryException { if (definition == null && itemMgr != null) { if (isNode()) { definition = itemMgr.getDefinition((NodeState) state); } else { definition = itemMgr.getDefinition((PropertyState) state); } } return definition; }
the instance variable 'definition' is never reloaded once it has been loaded for some session which cause the problem
Attachments
Issue Links
- is awaited by
-
CHANNELMGR-1349 Can not save document when property.isMultiple mismatches the multiple configuration of the related doctype
- Closed
- relates to
-
REPO-1733 Add an integration test to the repository confirming property definitions get reloaded for residual properties when for example multiplicity changes
- Closed