Hi Stefan,
I have updated the WRITEBACK option. From now on, it will only be applied to documents and collections that have been read from disk, and not to database instances [1]. This may not have been the original intention of your posting, but I believe it’s the cleanest solution..
Thanks, Christian
[1] https://github.com/BaseXdb/basex/issues/786 ___________________________
On Fri, Nov 8, 2013 at 6:51 PM, Christian Grün christian.gruen@gmail.com wrote:
…I’ve made it an GitHub issue: https://github.com/BaseXdb/basex/issues/786
On Fri, Nov 8, 2013 at 5:31 PM, Christian Grün christian.gruen@gmail.com wrote:
- Concerning your comment on using the WRITEBACK option only for single
file data bases: debugging the basex server yields that when using more than one xml document (via the ADD command), the "original" field in the MetaData class is not set, thus the WRITEBACK operation does not write anything in these situations.
…exactly. The original URI of added resources will not be stored in the database, and the optional "original" string you mentioned refers to the path of a single resource, which was added in the database creation process.
- When raw files reside in the database (added via STORE commands) in
addition to the single initial xml data file, then an error is thrown upon every xquery write statement stating: Stopped at .../backend/restxq/ajax/addmodel.xqm, 10/10: [FOUP0002] ".../backend/data/gallery.xml" could not be written.
I agree that it would make sense to reduce the number of unwanted side effects caused by the WRITEBACK option. I even think the best solution is to only write back files when updating documents that have been created within a query, e.g...
delete node doc("file-on-disk.xml")//abc
and disallow updates on database instances.
Thanks, Christian
At the same time the file gallery.xml is in fact updated to reflect the write operations changes.
Than you Stefan
Am 06.11.13 19:58, schrieb Christian Grün:
Dear Stefan,
- My impression is that the WRITEBACK option only works for databases
directly created from an initial input xml file (CREATE DB <name> <input.xml>). Is that true? My other tests involving ADD <file.xml> commands failed to write back inserted or deleted nodes.
that’s correct: the WRITEBACK option is only recommendable if you are working with single files. Usually, the EXPORT command is the better choice for writing database contents back to files.
- I checked out the latest git version and noticed that the WRITEBACK
option is not read from the .basex file anymore. In version 7.7.2 that I used for the other tests it was read.
Thanks for the observation; I have committed a fix and uploaded a new snapshot, which should fix the problem [1].
Christian
[1] https://github.com/BaseXdb/basex/commit/2d618a18f4b2ad14cc17b15d155320a088f8...
Am 25.10.13 18:04, schrieb Dirk Kirsten:
Dear Stefan,
please be aware that this is a english-speaking mailing list. As we want most of our users to benefit from all questions and answers I'll stick to english in my response (and aa your web page is in English as well I guess it is no obstacle for you).
Regarding your question about saving plain xml files: You can use the Export Command (see https://docs.basex.org/wiki/Commands#EXPORT) to export all your documents. You can e.g. use a cron job to export them regularly. There also is a writeback option (https://docs.basex.org/wiki/Options#WRITEBACK), which will update your original input nodes.
Secondly, regarding your question about empty WebDAV files: Please take a look at a recent discussion on the list (see https://mailman.uni-konstanz.de/pipermail/basex-talk/2013-September/005453.h...), which is about the same topic. Short answer: With another viewer it should work. Computing the size is quite difficult as we store the data in a special storage format to speed up querying. Seems like some viewers don't like it if the file size isn't correct.
Cheers, Dirk
On 25/10/13 17:27, Stefan Sechelmann wrote: > Hallo, > ich bin dabei BaseX für unser aktuelles Projekt zu evaluieren. Bis jetzt > sieht alles danach aus als ob BaseX genau das ist wonach wir gesucht > haben. Hier meine Fragen dazu: > > - Der Datenbankserver speichert seine XML-Daten optimiert in .basex > Files. Gibt es die Möglichkeit den Server auch XML Files schreiben zu > lassen (So wie er das mit raw Files tut), so dass ich alles auch ohne > BaseX ansehen kann? Gibt es vielleicht einen automatischen Export? > > - Der Webdav-Support kommt mir unstabil vor. Wenn ich XML-Dateien > kopiere sind diese danach teilweise leer oder werden vom Server als RAW > erkannt. Ich benutze einen Mac und den Finder als Client. Sind das > eventuell bekannte Probleme oder muss ich bei mir suchen? > > Vielen Dank > Stefan Sechelmann >
-- Stefan Sechelmann DFG-Forschungszentrum Matheon Mathematik für Schlüsseltechnologien Technische Universität Berlin Sekretariat MA 8-3 Tel. 030/314 29 486 Straße des 17. Juni 136 Fax 030/314 79 282 10623 Berlin sechel@math.tu-berlin.de http://www.math.tu-berlin.de/~sechel
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- Stefan Sechelmann DFG-Forschungszentrum Matheon Mathematik für Schlüsseltechnologien Technische Universität Berlin Sekretariat MA 8-3 Tel. 030/314 29 486 Straße des 17. Juni 136 Fax 030/314 79 282 10623 Berlin sechel@math.tu-berlin.de http://www.math.tu-berlin.de/~sechel