Hi, On 4/24/07, Christoph Kiehl <[EMAIL PROTECTED]> wrote:
Christoph Kiehl wrote: > I tried the following: > > testWorkspace.clone("default", "/" , "/" , false);My second try was to just clone one of our root nodes: testWorkspace.clone("default", "/content" , "/content" , false);
The target path of the clone() method is defined as the "absolute path to the parent node of the new location, appended with the new name desired for the cloned node", so using just "/" doesn't work.
This failed because of the following exception: Caused by: javax.jcr.ReferentialIntegrityException: Target node c83ca884-4ad4-40a3-a6da-0fb5b8c33608 of REFERENCE property does not exist
You probably have more than one subtree below the root node and references across these subtrees. When you clone() just a single subtree at a time the references get broken.
Is there any way to clone a whole workspace? Without referential integrity problems?
My usual recommendation is to use a separate "application root" node like "/my:content" under which you put all the content in your application. This way you can clone the entire application in one piece without the reference issues. You could do that just for the migration by 1) creating such a application root node, 2) moving all other subtrees below that node, 3) cloning the entire tree to a new workspace, and 4) moving the subtrees back to the root of the new workspace.
Apparently clone() seems to copy the whole content into memory before saving it to the destination workspace. Is that true?
Yes, unfortunately. Given the current ChangeLog implementation, Jackrabbit keeps all changesets in memory regardless of whether they go through the transient space or not. BR, Jukka Zitting
