Dear Aleks,
> Adding a flag would be great , this will helps out so that we can sync database changes into xml file in one call.
I've added the flag which allows updates files to be written back to
disk. Note that, currently, all files of a modified database will be
written back to disk after an update operation has been completed.
Note that this is experimental; you're invited to test the latest
version of the sources, which you find in our Subversion repository.
The flag can be activated via the SET command in BaseX:
Command Line:
set writeback on; create db input.xml; xquery delete node //text()
BaseX API:
Context ctx = new Context();
new Set("WRITEBACK", true).execute(ctx);
new CreateDB("input.xml").execute(ctx);
new XQuery("xquery delete node //text()").execute(ctx);
> We are getting the following exception while performing query against database :
> Main.notexpected(Object...) line: 205
> TableDiskAccess.cursor(int) line: 326
> [...]
> Can you shade some light why would this happen ? this problem happens randomly.
This exception might (but need not) indicate an inconsistency in the
data storage. It would be great if you could try to create a
reproducible example – although I guess this might not be easy if the
issue occurs only randomly.
> We currently create a single Context object for every open database and keep passing this context for every call, do you think this will cause the problem ?
That should be fine. Do you close the database/context – data.close()
/ context.close() – after all updates have been processed?
All the best,
Christian