I'm trying to set a unique ID on all files and directories when they are 
created; a UUID or GUID.

I setup a create trigger to set a <uuid>{$ guid}</uuid> property on the 
file/directory.

However, it would appear that triggers are not fired on directory operations.

Now, working around this, when files are created I check for this property on 
the file's parent directory and if it does not exist call 
xdmp:document-set-property( $parentUri, <uuid>{$parentUuid}</uuid> ).  However, 
it would seem that xdmp:document-set-property() is not reentrant because I can 
end up with multiple copies of <uuid> on a parent directory.  This has actually 
happened if I drop a directory with multiple children into a WebDAV folder.

Now we are talking about a concurrency issue and I need to lock the parent 
properties before I read and potentially update it... but I don't want to lock 
a directory for every file creation because that will cause all transactions in 
that directory and subdirectories to fail or be serialized.

If create triggers worked for directories this would not be an issue, we could 
set the property on directory creation and be done with it.

Has anyone run into this, and if so how did you solve this problem?

Thanks,

Keith L. Breinholt
ICS Content & Media
[email protected]<mailto:[email protected]>
"Do what you can, with what you have, where you are." Theodore Roosevelt


 NOTICE: This email message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please contact the sender by reply email and destroy all 
copies of the original message.


_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to