Oddly enough, I cannot reproduce by myself!
Still, when I browse the database, the /DB/path only exists once (as far as I can see from the sorting), but querying is giving me two documents, according to db:path() living in the same path. This should never happen, should it?
I will simply drop the database, but I wish I could understand what went wrong. I just did the same updating query and it is politely replacing the second file without adding another one (still, the initial file remains unreplaced).
Thanks, Daniel
-----Ursprüngliche Nachricht----- Von: Christian Grün [mailto:christian.gruen@gmail.com] Gesendet: Montag, 29. April 2019 11:08 An: Zimmel, Daniel Cc: BaseX Betreff: Re: [basex-talk] db:replace() in DBA resulting in duplicates
Hi Daniel,
seems hard to reproduce. Could you tell me what you did step by step? This is what I tried:
- I created a DB database.
- I added the document <root id='id'/> to the database path /path/file.xml.
- I replaced this document with the same document via the DBA.
- Your query db:open('DB')/root[@id='id']/base-uri() returned a single string.
Thanks in advance, Christian
PS: The form parameter handling in 9.2 contains a little bug (as a result, I couldn’t invoke the replace functionality with the current version). I just uploaded a new snapshot. Both the current and the snapshot version should behave identically in terms of adding and replacing documents.
On Fri, Apr 26, 2019 at 4:45 PM Zimmel, Daniel D.Zimmel@esvmedien.de wrote:
Hello,
something has gone awry in my database after a db:replace():
query: db:open('DB','/path/file.xml')/base-uri()
result: /DB/path/file.xml
This is as expected. The result is the replaced file. But when I
query: db:open('DB')/root[@id='id']/base-uri()
result is a sequence: /DB/path/file.xml /DB/path/file.xml
The first result is the file before the db:replace(), the second after.
Can somebody explain why db:open() with path parameter is returning one
result, but without parameter two results?
Database statistics say there are indeed two documents. But when I export the
database, only one gets exported.
This happens with db:replace() on 9.2 from the DBA browser interface. When I use the same db:replace() XQuery on 9.2 with my local database, all is
well (document gets replaced, no duplicates). Settings should be the default ones.
Thanks, Daniel