I see. No, there is no trigger event for updated or deleting a lock. When the lock is released, you can put some logic in the code that releases the lock to remove the shadow document at the same time as releasing the lock. That would not work for an expiring lock though.
Maybe you could create a scheduled task that periodically looks for locks (maybe based on your existing shadow document) and then deletes the shadow document if the lock does not exist? The task would be sort of like a periodic garbage collection for your shadow documents. See the "Scheduling Tasks" chapter in the Admin Guide (http://developer.marklogic.com/pubs/4.1/books/admin.pdf) for information how to set up a scheduled task. -Danny -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jeroen Pulles Sent: Thursday, November 19, 2009 12:24 AM To: General Mark Logic Developer Discussion Subject: Re: [MarkLogic Dev General] How to run code when lock expires? Hi, When I take the lock, I also make a shadow copy of the document. I would like to remove that particular document when either the lock is released or the lock expires. regards, Jeroen On Wed, Nov 18, 2009 at 6:45 PM, Danny Sokolsky <[email protected]> wrote: > Hi Jeroen, > > I am not quite sure what you are asking here. A lock does not prevent you > from running XQuery code, it just prevents a document from being updated. > If you have a lock on a document, you can run a query to unlock it. If the > lock expires, then the document is no longer locked. > > But I think I do not understand your question. What are you trying to do? > > -Danny > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Jeroen Pulles > Sent: Wednesday, November 18, 2009 3:36 AM > To: General Mark Logic Developer Discussion > Subject: [MarkLogic Dev General] How to run code when lock expires? > > Hi, > > Is there a way to invoke an XQuery module when a lock expires? > Can I do this with triggers? > > Or: Are there other alternatives to run code after a given time, > so that an alternative solution could replace my locking application. > > regards, > Jeroen > > -- > Jeroen Pulles > Xopus B.V., The Netherlands > > Xopus: The web based WYSIWYG XML word processor > _______________________________________________ > General mailing list > [email protected] > http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
