jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-15) PersistentNode.store() ignores status when storing
Date Thu, 04 Nov 2004 16:06:34 GMT
     [ http://nagoya.apache.org/jira/browse/JCR-15?page=comments#action_55041 ]
Felix Meschberger commented on JCR-15:

Now those additions provide a real performance boost. Unfortunately, the version history is
lost when the repository is shutdown...

The problem is, that ItemState and its descendents (NodeState, PersistentNodeState) do not
properly handle the status field. For example the NodeState.addChildNodeEntry does not set
the status to modified. Consequently, the NodeState is not transient when it is time to store
and therefore, it is never stored.

What happens is :
   - create a mix:versionable node
     - internally creates the version history (call it XX) below
     - creates nodes and properties below XX and stores them
     - but as XX itself is not transient, XX is not stored.

The net effect is that the version history nodes and properties exist, but the jcr:persistentVersionStorage
node has no link to the version history node just created.

The next time the repository is started, a NullPointerException is thrown if the version history
of the node initially created is accessed.

Steps to reproduce:
   - Start empty repository
   - Create a mix:versionabl node "/root"
   - Save "/"
   - Shutdown the repository
   - Start the repository
   - Access the version history of "/root"

At that point you get a NullPointerException on line 103 of the InternalVersionHistory class.
(SVN Version 56602 of the class)

> PersistentNode.store() ignores status when storing
> --------------------------------------------------
>          Key: JCR-15
>          URL: http://nagoya.apache.org/jira/browse/JCR-15
>      Project: Jackrabbit
>         Type: Bug
>  Environment: Jackrabbit SVN revision 55714
>     Reporter: Felix Meschberger
>     Assignee: Tobias Strasser

> While looking for a performance bottle neck I came across this issue: When a PersistentNodeState
is asked to store itself in the PersistentNodeState.store() method, it calls its PersistenceManager
to store it.
> This is not a problem in itself. The problem is, that if the PersistentNodeState has
not been modified, the object does not need to be stored. Doiing it anyway just consumes cycles
! In the case of a deep, unmodified hierarchy, this just results in nodes being written to
persistence for nothing.
> Comes to it, that this method sends an event, which in the case of an unmodified node
state will be notifyStateUpdated(), which is complete nonsense, because nothing has actually
been updated.
> I suggest to modify the PersistentNodeState.store() method to only do work if modified.
> Note: I encountered this issue, whily tracking down performance problems when creating
versionable nodes, which turned out to be located somewhere within the PersistentVersionManager.createVersionHistory(NodeImpl)
method. And there, predominantly the store() methods consume time.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
If you want more information on JIRA, or have a bug to report see:

View raw message