Hi Christian, Follow our conversation regarding Basex. Can you please advice me on how to best perform the following functionality with BaseX.
1) XSD validation, currently BaseX does not provide any good way to perform XSD validation and all writes are always flushed to the disk. This will potentially can cause a problem, because incorrect changes can break consistency of the database. In addition to this it's a bit heavy to keep complete xml in the memory just for the purpose of validation due to the fact that database can grow to a large size.
2) Currently all writes to database only reflect in internal BaseX file system, the changes does not apply to XML file right away, unless you specifically copy it over, is there are a good way where you can force BaseX also update xml file with the changes.
Thank you for your time!!
--Aleks
-----Original Message----- From: Christian Grün [mailto:christian.gruen@gmail.com] Sent: Sunday, January 24, 2010 8:21 AM To: Alexander Sheynkman Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] BaseX db questions
Dear Aleks,
Thank you very much for your time, Just to clarify on point #2 regarding close. What I understood from you if I have an application that is managing multiple embedded database ( let say 3 ) at the same time and needs to constantly run query / updates on these db's , then I just need to Open it once on startup and the close it whenever I'm done with database.
That's true. Opening database is a very fast operation, however, so a second, easier alternative is to implicitly open and query the database within XQuery expressions, as shown in the following two sample queries:
-- doc('dbname')/path/to/elements -- for $x in basex:db('dbname')/to/be/deleted return delete node $x
How about OPTIMIZE , I see you suggested to run it after all kinds of database updates, is it true ?
The optimize command refreshes meta data and index structures of a database, which might speed up the evaluation of new XQuery requests. We decided to make database optimization an optional feature to allow for a much faster evaluation of update queries.
Feel free to ask for more, Christian