Dear Jennie,

Thank you for your explanation. Do you know if it is possible to delete 
a document from the db-farm? Since when I try to simply overwrite the 
old file by doing a new put-statement with another XML-element with the 
same name, MonetDB crashes with a segmentation-fault when doing a new 
get-statement for the same file.

In short:

cq:PUT("tmp/test.xml",<bla/>)
// no problem
cq:GET("tmp/test.xml")
// returns <?xml version="1.0" encoding="utf-8"?><bla/>
cq:PUT("tmp/test.xml",<bladiebloe/>)
// no problem (it seems)
cq:GET("tmp/test.xml")
// Segmentation fault

I checked the db-farm directory and after the crash it does contain: 
<?xml version="1.0" encoding="utf-8"?><bladiebloe/>
So that seems to be OK.

Thank you for your help.

Best regards,

Arthur







Ying Zhang wrote:
> Hi Arthur,
>
> with PUT, your node is serialized to disk, in the file 
> "<dbfarm>/<db>/tmp/test.xml"
> it is not shredded at all, you can see this by using xmldb_print() in a
> Msever console.  So the problem seems to be caused by that _del_doc does
> not recognize a document that is stored on disk but not shredded...
>
>
> Jennie
>
>
> On Wed, Mar 07, 2007 at 09:18:31PM +0100, Arthur van Bunningen wrote:
>   
>> Dear All,
>>
>> To  be able to create a soap-interface with support for the dynamic 
>> management of xml documents I created a XQuery module with some simple 
>> document management functions, which I stole from 
>> "pathfinder/runtime/xrpc/admin/admin.xq" (the code is found at the end 
>> of this mail).
>>
>> To test the functions without soap, I created tree simple xqueries. Now 
>> adding and displaying documents works perfectly. However, when I want to 
>> delete a document I get: "ERROR = !ERROR: _del_doc(tmp/test.xml): 
>> document not found in database (1 such errors)! !ERROR: 
>> interpret_params: shred_doc_base(param 1): evaluation error.".
>>
>> Maybe this is because the document is not shredded in an ordinary way, 
>> however I do not know of any other function that can insert documents 
>> without a physical location.
>>
>> If someone could help me to delete these documents, or point me to 
>> another way of inserting documents without a physical location (, or 
>> show me the stupid mistake I made :) ), this would be very much appreciated.
>>
>> Best regards,
>>
>> Arthur
>>
>>
>>
>>
>> The module looks as follows:
>> ==========================
>> module namespace cq = "http://db.cs.utwente.nl/cq#";;
>> declare updating function cq:PUT($uri as xs:string, $doc as element())
>> {
>>   if (substring($uri, 1,4) = 'tmp/')
>>   then put($doc, $uri)
>>   else error('PUT: only relative URIs starting with tmp/ allowed')
>> };
>>
>> declare function cq:GET($uri as xs:string)
>> { doc($uri) };
>>
>> declare document management function cq:DELETE($uri as xs:string)
>> {
>>   if (substring($uri, 1,4) = 'tmp/')
>>   then pf:del-doc($uri)
>>   else error('DELETE: only relative URIs starting with tmp/ allowed')
>> };
>>
>> ==========================
>> The three test files look as follows:
>> ==========================
>> import module namespace cq = "http://db.cs.utwente.nl/cq#"; at 
>> "/home/db/bunninge/phd/implementation/xquery/try3_module/ca_module.xq";
>> cq:PUT("tmp/test.xml",<bla/>)
>> ==========================
>> import module namespace cq = "http://db.cs.utwente.nl/cq#"; at 
>> "/home/db/bunninge/phd/implementation/xquery/try3_module/ca_module.xq";
>> cq:GET("tmp/test.xml")
>> ==========================
>> import module namespace cq = "http://db.cs.utwente.nl/cq#"; at 
>> "/home/db/bunninge/phd/implementation/xquery/try3_module/ca_module.xq";
>>  cq:DELETE("tmp/test.xml")
>>
>>
>>
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> MonetDB-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/monetdb-users
>>     


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MonetDB-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-users

Reply via email to