Yes, Alexander,

I actually miss this fact. You can not update the same  document inside a
trigger because of locking.

Solution is to create another separate document for the timestamp and update
it inside your On-Replace-trigger.

Maria

2008/12/12 Alexander Kardailsky <[email protected]>

> Dear Maria,
>
> Thursday, December 11, 2008, 2:23:09 PM, you wrote:
>
> > since you are replacing
> > doc("categories")/categories/catego...@id=8]/@idx
> >  (attribute idx)
> > you need to set a trigger on it. Currently your trigger is set on
> > doc("categories")/categories and will fire when you replace the
> > whole categories subtree (rooted with 'categories' node).
>
> > CREATE TRIGGER "update_categories_timestamp"
> > AFTER REPLACE
> > ON doc("categories")/categories/category/@idx
> > FOR EACH STATEMENT
> > DO
> > {
>
> > UPDATE replace $b in doc("categories")/categories/@
> > timestamp with attribute timestamp {current-dateTime()};
>
> > }
>
>   Thank you. However it's a bit different. I want to change timestamp
>  in <categories> each update replace in any <category>, I tried to use
>  ON doc("categories")//category but it doesn't work too. Or it's
>  impossible to do at all because of document locking?
>
> --
> Best regards,
>  Alexander
>
>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to