Hi,
sometimes in my update operations BaseX deliberately is spawning several databases like the following, with a name of the database plus underscore and number:
DBNAME_2618234251
caused by
db:replace($dbname, $dbpath|| '/' || $fname, $file-to-import, map { 'intparse': true(), 'chop': false(), 'addcache': false() })
I cannot find anything about this behavior in the docs. It seems to happen randomly, and the main database does seem ok.
How can I avoid these extra databases? They will vanish only by force.
BaseX 9.2.1
Thanks, Daniel
Hi Daniel,
It looks as if databases are not cleaned up in your environment that are temporarily created during the update step.
I guess it will be difficult for you to get this reproduced for us?
Best, Christian
DBNAME_2618234251
caused by
db:replace($dbname, $dbpath|| '/' || $fname, $file-to-import, map { 'intparse': true(), 'chop': false(), 'addcache': false() })
I cannot find anything about this behavior in the docs. It seems to happen randomly, and the main database does seem ok.
How can I avoid these extra databases? They will vanish only by force.
BaseX 9.2.1
Thanks, Daniel
It looks as if databases are not cleaned up in your environment that are temporarily created during the update step.
I guess it will be difficult for you to get this reproduced for us?
Indeed.
It does happen on Windows and Linux, though. I pretty much run the default setup.
This is a complete example of a simple import query:
declare variable $system external; declare variable $config := fetch:xml(file:base-dir() || '../../config/config.' || $system ||'.xml')/basexconfig; declare variable $dbname := string($config/esvxml/database/esvschema); declare variable $sourcefile := string($config/esvxml/import/paths/sourcefile)
for $source in fetch:xml($sourcefile)/sources/*/path where file:is-dir($source) let $path := $source let $produkt := $source/@produkt let $produkttyp := $source/parent::*/name() let $xmlprozess := $source/@xml for $file in file:list($path, true(), '*.xml') return db:add($dbname, $path || $file , $produkttyp||'/'||$xmlprozess||'/'||$produkt||'/'||$file, map { 'intparse': true(),'chop': false(), 'addcache': true(), 'skipcorrupt': true() })
Nothing special in here.
It seems safe to delete those temporary databases regularly, then? Too bad I cannot reproduce.
Thanks, Daniel
In your first query, ADDCACHE was set to false. Does the problem exist in both cases?
It seems safe to delete those temporary databases regularly, then?
Absolutely.
Just guessing: • Did you get any errors reported while performing updates? • Do you have any symbolic links (and potential circular dependencies) in the directory you are parsing?
In your first query, ADDCACHE was set to false. Does the problem exist in both cases?
Definitely.
Just guessing: • Did you get any errors reported while performing updates?
No.
• Do you have any symbolic links (and potential circular dependencies) in the directory you are parsing?
No.
BTW there is a db:lock message when I try to remove them via RESTXQ (DBA module). I will try to get back if any other hint shows up that might help.
Thanks, Daniel
basex-talk@mailman.uni-konstanz.de