jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Reschke <julian.resc...@gmx.de>
Subject Re: SessionTest.testSaveInvalidStateException vs OAK
Date Wed, 06 Jun 2012 16:11:10 GMT
On 2012-06-06 17:48, Jukka Zitting wrote:
> Hi,
> On Wed, Jun 6, 2012 at 5:16 PM, Michael Dürig <mduerig@apache.org> wrote:
>> On 6.6.12 14:20, Julian Reschke wrote:
>>> At first glance, this seems to be another case of where the test needs
>>> to refresh() before saving, because in Oak, the session doesn't
>>> necessarily have the latest changes.
>> This is necessary in any case and should be fixed in the test case.
> The test is IMHO fine, what we need is Session.save() to do an
> implicit refresh() (or an equivalent rebase operation) before
> committing transient changes. In fact IIUC that's already the case
> here.
>> This is caused by the way refresh(true) is currently implemented. It does
>> basically a rebase operation: it re-applies all changes of the current
>> session to the current trunk. Now when a node does not exist any more in
>> trunk and there are changes to the sub tree rooted at that node, these
>> changes are silently discarded.
> Perhaps we should replace such cases with conflict markers that
> prevent the transient space from being resolved (for example with a
> commit hook that prevents such markers from being present in commit).
> Only if the session then explicitly removes or re-adds the modified
> subtree, thus clearing the conflict marker, can the save succeed.

That sounds like a good idea.

Should we open a ticket describing the problem? That would allow me to 
annotate the test exclusions in the pom.xml with pointers t related work 

Best regards, Julian

View raw message