[basex-talk] BaseX 7.3 CREATE DB command fails with: "database locked"

2012-07-13 Thread Godmar Back
Hi,

I"m using BaseX 7.3 using the client/server interface with the
org.basex.ClientSession driver.

After working for a while, BaseX starts failing with:

Fri Jul 13 14:39:23 EDT 2012:
198.82.2.41:B38B8E21E30111A56E8A828453F4E768:z_orj:
Unexpected exception: org.basex.core.BaseXException: Database
'PUB_feed_libx_dot_editions_at_gmail_dot_com_core' is currently opened by
another client.
org.basex.core.BaseXException: Database
'PUB_feed_libx_dot_editions_at_gmail_dot_com_core' is currently opened by
another client.
at org.basex.server.ClientSession.receive(ClientSession.java:259)
at org.basex.server.ClientSession.send(ClientSession.java:246)
at org.basex.server.ClientSession.send(ClientSession.java:284)
at org.basex.server.ClientSession.create(ClientSession.java:129)

This happens when I attempt a 'CREATE DB' command.

The log shows:

14:39:23.094[127.0.0.1:47974]:
ts_20120713_dot_143922_dot_654_feed_libx_dot_editions_at_gmail_dot_com_core
 CREATE DB PUB_feed_libx_dot_editions_at_gmail_dot_com_core [...]
14:39:23.098[127.0.0.1:47974]   Error: Database
'PUB_feed_libx_dot_editions_at_gmail_dot_com_core' is currently opened by
another client.   4.05 ms

I don't understand what 'locking' or "opened by another client" refers to
in this context - certainly not something I'm doing. I'm exclusively using
the commands documented at http://docs.basex.org/wiki/Commands none of
which is an 'open' or 'lock' command.

Again, this makes BaseX unusable - we can't create a reliable server if
database operations start failing after a while.

This happened after a series of operations - it's not something I can
easily create a test case for (due to the fact that BaseX's log are
incomplete so I can't simply replay the dozens or so operations I did
before BaseX locked up in this way.) It happens regularly, and has happened
in BaseX 6.6.3 (I've waited to report it after I upgraded to 7.3).

 - Godmar
___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk


Re: [basex-talk] recusive subdirectory suggestion

2012-07-13 Thread Michael Seiferle
Dear Kurt, 

thanks for the Kudos and thanks for your suggestion as well. 
As a quick solution you could do the following (entirely in XQuery ;-)): 

Use file:list($dir, false(), "*.xml") [1] to retrieve a sequence of files 
without recursing into a subdirectory.
Then either
(1) Iterate over this sequence and perform your analysis on the fly
or
(2) create a database containing only the matching files and perform 
the analysis afterwards

For (1) and (2) see this GIST: https://gist.github.com/8488e895c5f73ac4de49

I hope this helps :-)

Kind regards
Michael 

[1] http://docs.basex.org/wiki/File_Module#file:list
[2] https://gist.github.com/8488e895c5f73ac4de49

Am 13.07.2012 um 07:35 schrieb Kurt Conrad:

> First, I just downloaded and used BaseX to audit and report a variety of 
> parent contexts across a set of about 2,500 XML documents. It was very 
> painless. Many thanks.
> 
> Second, I couldn't find a way to prevent recursive indexing of 
> subdirectories. If the feature doesn't exist, it would be handy. In my case, 
> I had the current set of files in the selected directory and old versions in 
> subdirectories.
> 
> Thanks, again.
> 
> /s/ kwc 2012.07.12 22:34
> 
> ___
> Kurt Conrad
> mailto:con...@sagebrushgroup.com
> www.SagebrushGroup.com
> 
> ___
> BaseX-Talk mailing list
> BaseX-Talk@mailman.uni-konstanz.de
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk

___
BaseX-Talk mailing list
BaseX-Talk@mailman.uni-konstanz.de
https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk