Bugs item #2744564, was opened at 2009-04-08 19:43
Message generated for change (Comment added) made by shcheklein
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=713730&aid=2744564&group_id=129076

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Triggers
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Konstantin (drideru)
Assigned to: Nobody/Anonymous (nobody)
Summary: INSERT trigger is called upon UPDATE REPLACE

Initial Comment:
The INSERT BEFORE TRIGGER is called when the UPDATE REPLACE is executed. Found 
out because there might be another bug, which I will post separately.

CREATE TRIGGER "rwipinfdir:500_insert_site_before"  
BEFORE INSERT  
ON doc("infrastructure")//site  
FOR EACH NODE  
DO  
{

        let $node:=$NEW

(:insert new id:)
        let $node:=
                <site>
                        {$node/@*,
                         attribute {"id"} {concat("site_id_", $idnext)},
                         $node/*}
                </site>

(:insert name:)
        let $node:=
                <site>
                        {$node/@*, $node/*}
                        <name>new site</name>
                </site>

(:insert description:)
        let $node:=
                <site>
                        {$node/@*, $node/*}
                        <description>The new site was created but the 
information was not customized yet.</description>
                </site>

(:insert log:)
        ...
        let $node:=
                        <site>
                                {$node/@*, $node/*}
                                <log>
                                        
<createdBy>{string($partner/@id)}</createdBy>
                                        
<createTimestamp>{$timestamp}</createTimestamp>
                                        
<modifiedBy>{string($partner/@id)}</modifiedBy>
                                        
<modifyTimestamp>{$timestamp}</modifyTimestamp>
                                </log>
                        </site>

        
        return $node;    

}

The INSERT operation is working nicely

UPDATE INSERT <site/> into doc("mydoc")


The UPDATE REPLACE operation strangely (at least for me) executes also the 
INSERT BEFORE trigger. With that only section with LOG creates the error.

2009/04/08 17:31:31 database query/update failed (SEDNA Message: ERROR SE3205
Trigger action tries to update a document/collection that is currently updating 
by the outer update statement.
Details: mydoc

----------------------------------------------------------------------

>Comment By: Ivan Shcheklein (shcheklein)
Date: 2009-04-08 23:45

Message:
Konstantin, could you provide us an example of the document and exact
queries to reproduce the issue on? 

----------------------------------------------------------------------

Comment By: Konstantin (drideru)
Date: 2009-04-08 19:49

Message:
Oh no, will not post the other bug/?. it is already described here. it
appears when the <log> section is inserted. it has two levels.

it does not appear if only <name> or <description> is inserted (UPDATE
REPLACE only).

So totally two bugs.
TRIGGER INSERT BEFORE is called upon UPDATE REPLACE.
Adding a subnode of more than one level deep in this trigger, when it is
called upon UPDATE REPLACE, causes the error SE3205.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=713730&aid=2744564&group_id=129076

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to