You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2013/11/25 17:49:36 UTC

[jira] [Commented] (OAK-1056) Transient changes contributed by commit hooks are kept in memory

    [ https://issues.apache.org/jira/browse/OAK-1056?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13831617#comment-13831617 ] 

Michael Dürig commented on OAK-1056:
------------------------------------

I was quickly looking into fixing this with the help of the reset functionality from OAK-1203. However I fear this is not possible without violating an important invariant of node builders. Currently two node builders acquired from the same node state are isolated from each other: changes from one builder are not visible in the other. However say we introduce the concept of a resettable node builder, which could be used by the commit hook. This would allow us to reset to the previous state if the commit hook fails the commit. But at the same time would a second builder acquired from the same root node state share the (persisted) state of the first builder. Hardly want we want.... 

> Transient changes contributed by commit hooks are kept in memory
> ----------------------------------------------------------------
>
>                 Key: OAK-1056
>                 URL: https://issues.apache.org/jira/browse/OAK-1056
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: core
>            Reporter: Michael Dürig
>
> With the {{KernelNodeStore}}, transient changes contributed by commit hooks are currently kept in memory instead of being written ahead to the private branch. The reason for this is that we need to be able to undo such changes if a commit hook later in the process fails the commit. Doing this efficiently would need some support from the persistent layer. Either the ability for branching from a branch or the ability to roll back to a previous state. 
> See the TODOs in {{KernelNodeState.builder()}}, which returns a MemoryNodeBuilder (instead of a KernelNodeBuilder when the current state is on a branch. This is the workaround to avoid branching form a branch and has the effect that commit hooks currently run against a MemoryNodeBuilder and limits the amount of changes commit hooks can add.



--
This message was sent by Atlassian JIRA
(v6.1#6144)