-
-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copyCollection creates orphaned documents when target collection name is the same as source #99
Comments
It is all about WebDAV? That is: by calling the WebDAV methods? Or is it in General? |
This behavior of eXist's core. I think that exception is normal, or better to say, expecting reaction. @adamretter @wolfgangmm , what do you think? |
I have been thinking a bit more on this: For me, this kind of protection should be on application level, not on the 'core'. I do not want this protection out of the box, my move command....... should just be moving data. |
Dannes I have a very hard time understanding why that would be preferable. 1.) This isn't how any other system operates, especially unix. eXist is On Mon, Dec 16, 2013 at 2:45 PM, Dannes Wessels notifications@github.comwrote:
Casey Jordan This message is intended only for the use of the Addressee(s) and may |
Casey I agree with you. This has to be recognised as a bug in the core, of course we should never be intentionally orphaning files! The only question is whether to either: a) Throw an Exception at (3) if the collection already exists My preference here would be to avoid exceptions and do (c) i.e. just one-way merge the source to the destination during the copy, this is exactly what happens on a UNIX system. e.g. given the filesystem: /1/A/hello.txt and given the command: "cp -r /1/A /2" Then, /2/A ends up with both hello.txt and goodbye.txt files, any files with the same name that existed in both /1/A and /2/A would have been overwritten in /2/A by the copy. I meant to add that, if you need |
Adam, I see the appeal to this approach. It's certainly better than the It's somewhat like the age old practice of creating a new alias for 'mv' On Mon, Dec 16, 2013 at 3:11 PM, Adam Retter notifications@github.comwrote:
Casey Jordan This message is intended only for the use of the Addressee(s) and may |
To reproduce:
1.) Create a collection with documents in it.
2.) Copy that collection to a seperate location
3.) Copy it back over the original
4.) Take a backup and see all the original files are now in the lost_and_found
IHMO the correct solution to this is to throw an exception when the target collection exists to prevent data loss. The same should be applied to moveCollection, which will simply delete the target if it exists. Without an exception being thrown this creates a situation for data loss to occur very easily without warning.
The text was updated successfully, but these errors were encountered: