jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OCM-49) ObjectContentManagerImpl should not use workspace copy and move but rather do it through the jcr session
Date Fri, 25 May 2012 13:30:22 GMT
Ard Schrijvers created OCM-49:
---------------------------------

             Summary: ObjectContentManagerImpl should not use workspace copy and move but
rather do it through the jcr session
                 Key: OCM-49
                 URL: https://issues.apache.org/jira/browse/OCM-49
             Project: Jackrabbit OCM
          Issue Type: Improvement
            Reporter: Ard Schrijvers
            Assignee: Ard Schrijvers
             Fix For: 2.0.0


The OCM interface has the following javadocs for 'save' :


   /**
     * Save all modifications made by the object content manager
     *
     * @throws ObjectContentManagerException
     *             when it is not possible to save all pending operation into
     *             the JCR repo
     */
public void save() throws ObjectContentManagerException;

In my opinion, this implies that a remove, insert, update, copy and move all are not persisted
until the save is being called. This is the case for remove, insert and update, but not for
copy and move: They are instant due to the workspace copy / move. 

Imo, these should be replaced. The workspace move results in *every* confusing problems. For
example currently with workspace move below works:

ocm.insert(a);
ocm.save();
ocm.move("/source", "/result");
assertFalse(ocm.objectExists("/source"));

But, if before the move you fetch the 'source' node (setting it to null, refreshing jcr session
etc etc does not help)


ocm.insert(a);
ocm.save();
// due to fetching node here, the unit test start to fail!!
Node n = ocm.getSession().getNode("/source");
ocm.move("/source", "/result");
assertFalse(ocm.objectExists("/source"));




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message