[ 
https://issues.apache.org/jira/browse/SLING-1281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798675#action_12798675
 ] 

Ian Boston commented on SLING-1281:
-----------------------------------

Checking the sequence of operations.

session.getItem("/d2-xxxx") goes into ItemImpl that retrieves a ItemId fromt he 
path from the Hierarchy manager, that itemsId is not found.

Looking that the resolution of ItemId to item, eventually the 
SessionItemStateManager looks for the ItemData from cache. Line 181 checks to 
see if the item has been removed, (d2 was removed earlier in the copy 
operation), and finds atticStore does indeed contain the item. However 
getTransientItemState(id) only looks in the transientStore which from the doc 
is only used for new and modified items, not removed items.

Looking at hasItemState(id) for a the SessionItemStateManager to return an 
item, if in the atticStore it must also be in the transientStore (since it was 
deleted and then created new again), otherwise it does not exist. 

Two observations here.
The /d2 node was removed, so it should be in the atticStore, but it should have 
been created by a new copy and so be in the transientStore. 

Need to check what happens if we copy to a node that doesnt exist, so doesnt 
need to be removed, and if the node really is created by the copy operation.



> Copy Move operations dont work.
> -------------------------------
>
>                 Key: SLING-1281
>                 URL: https://issues.apache.org/jira/browse/SLING-1281
>             Project: Sling
>          Issue Type: Bug
>    Affects Versions: Servlets Post 2.0.6, JCR Jackrabbit Server 2.0.6
>            Reporter: Ian Boston
>            Assignee: Ian Boston
>         Attachments: test-SLING-1281.sh
>
>
> To reproduce: 
> Create 2 content items: 
> * curl -X POST http://localhost:8080/d1 -u admin:admin 
> * curl -X POST http://localhost:8080/d2 -u admin:admin 
> Attempt to copy one item on top of the other: 
> * curl -F ":operation=copy" -F ":dest=d2" http://localhost:8080/d1 -u 
> admin:admin 
> Correctly encounter: 412 "Cannot copy JcrNodeResource, type=nt:unstructured, 
> path=/d1 to /d2: destination exists" 
> Attempt to copy one item on top of the other with :replace set to true: 
> * curl -F ":operation=copy" -F ":dest=d2" -F ":replace=true" 
> http://localhost:8080/d1 -u admin:admin 
> This should now succeed, however, it is returning: 
> 500 javax.jcr.PathNotFoundException: /d2 
> and we know for sure /d2 exists! 
> I think this might be related to changes in the pooling.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to