jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dürig <mdue...@apache.org>
Subject Re: SessionTest.testSaveInvalidStateException vs OAK
Date Wed, 06 Jun 2012 16:17:23 GMT


On 6.6.12 17:11, Julian Reschke wrote:
> 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.

Session.save() eventually results in a rebase operation in the 
Microkernel. But we should add a Root.rebase before that in order to be 
able to better handle potential conflicts.

>>
>>> 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.

Yes this sounds interesting and general enough to be also able to cope 
with other conflict situations. I will try to come up with something 
along these lines.

>
> 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
> items...

Yes, I'd do that. Could you also include a link to this discussion?

Michael

>
> Best regards, Julian

Mime
View raw message