Update operation is spawning new databases with underscore

Wednesday, 17 July 2019 · 5 messages · last reply 18 Jul 2019
ZD
Zimmel, Daniel17 Jul 2019 10:18 #

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

CG
Christian Grün18 Jul 2019 15:53 #

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

Quoted text · Zimmel, Daniel · 17 lines
> 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
ZD
Zimmel, Daniel18 Jul 2019 16:48 #
Quoted text · Christian Grün · 4 lines
> 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

CG
Christian Grün18 Jul 2019 16:54 #

In your first query, ADDCACHE was set to false. Does the problem exist in both cases?

Quoted text · Zimmel, Daniel · 1 line
> 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?

ZD
Zimmel, Daniel18 Jul 2019 17:52 #
Quoted text · Christian Grün · 2 lines
> In your first query, ADDCACHE was set to false. Does the problem exist > in both cases?

Definitely.

Quoted text · Christian Grün · 2 lines
> Just guessing: > • Did you get any errors reported while performing updates?

No.

Quoted text · Christian Grün · 2 lines
> • 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


⚡Generated with XQuery