Hi!
Within the documentation[1], you note that XQuery Updates are not reflected in the documents. There is an example of how to write queries that use fn:put to do such an update manually.
Under the assumption that XQueries and updates are far more frequent than document puts/pulls, wouldn't an 'inversed' technique be favorable? One that updates "dirty" documents upon fetching them rather than updating with each and every query? (Plus, as far as I see, not needing manual fn:puts is more interoperable)
Unfortunately, such 'inversion' would not only need an update to the API classes, but also the "core" (as "dirty" documents would need to be flagged). Would that be a reason the current implementation got as it is? Or don't I see some other issue?
HPO
Hans-Peter,
thanks for your interesting thoughts. Would you like to see the filesystem pulling dirty documents out of the database, or would you expect the database to perform updates on the filesystem if new queries are run against these documents?
To avoid fn:put, we've added a WRITEBACK flag, which writes back databases after an update operation:
set writeback on; xquery ...
…but this is indeed not desirable if many updates are performed.
Christian
On Tue, May 25, 2010 at 1:42 PM, Hans-Peter Oeri hp@oeri.ch wrote:
Hi!
Within the documentation[1], you note that XQuery Updates are not reflected in the documents. There is an example of how to write queries that use fn:put to do such an update manually.
Under the assumption that XQueries and updates are far more frequent than document puts/pulls, wouldn't an 'inversed' technique be favorable? One that updates "dirty" documents upon fetching them rather than updating with each and every query? (Plus, as far as I see, not needing manual fn:puts is more interoperable)
Unfortunately, such 'inversion' would not only need an update to the API classes, but also the "core" (as "dirty" documents would need to be flagged). Would that be a reason the current implementation got as it is? Or don't I see some other issue?
HPO
___________________________
Christian Gruen Universitaet Konstanz Department of Computer & Information Science D-78457 Konstanz, Germany Tel: +49 (0)7531/88-4449, Fax: +49 (0)7531/88-3577 http://www.inf.uni-konstanz.de/~gruen
basex-talk@mailman.uni-konstanz.de