Hello,
I've got 'Out of memory' error and corrupted database again, this time
it's for 6.3 version.
Steps:
1. Started server, started terminal client, checked there are no text
and attribute indexes.
2. Started my Java application that runs several tests on database:
querying, adding, removing.
3. Then I forgot to reopen terminal client and used the one that I
opened in Step 1.
4. Run optimize command for the collection and got error.
5. Cannot open the collection any more as I'm getting '…
[View More]Out of memory'.
It's clear that I shouldn't have used the terminal client that I opened
before execution of my Java application. But sometimes it's hard to
remember. And it's completely unacceptable that these actions result in
the corrupted database. You really should catch
ArrayIndexOutOfBoundsException everywhere in order to save database from
being corrupted.
Terminal client stacktrace:
> optimize
Possible bug? Feedback is welcome: basex-talk(a)mailman.uni-konstanz.de
BaseX 6.3:
java.lang.ArrayIndexOutOfBoundsException: -1
org.basex.data.PathSummary.add(PathSummary.java:68)
org.basex.core.cmd.Optimize.stats(Optimize.java:68)
org.basex.core.cmd.Optimize.run(Optimize.java:34)
org.basex.core.Command.run(Command.java:236)
org.basex.core.Command.exec(Command.java:218)
org.basex.core.Command.execute(Command.java:66)
org.basex.server.ServerProcess.run(ServerProcess.java:161)
> open products
Out of Main Memory.
Best regards,
Ivan
[View Less]
Forwarding to mailing-list...maybe interesting for others.
-------- Original-Nachricht --------
Betreff: Re: [basex-talk] Database creation from a directory tree
Datum: Fri, 31 Dec 2010 16:41:05 +0100
Von: Andreas Weiler <andreas.weiler(a)uni-konstanz.de>
An: david(a)leighweb.com
Hi David,
thanks a lot for your tests.
I couldnt fix the gui bug yet...but i can help you with command line...
There is a createfilter option...it can be set with:
set createfilter *
so all files in …
[View More]the folder are recognized for creating a database.
I hope this works for now,
Happy new year,
Andreas
Am 31.12.10 15:13, schrieb David leigh:
>
> Andreas,
>
> I just did an interesting test (using the version that the windows
> installer installs: 6.3.4).
>
> I copied my directory tree of files and in the new copy, I gave all my
> data files an extension of "xml" (previously they had NO extension).
> NOW, both with the command line and the GUI, the full database is
> created without any problem. To double check, I went back to the old
> directory with no extensions and created a new database using a filter
> of "*.*" and only 14 documents were created in the database (instead
> of 5000+).
>
> Conclusions:
>
> 1.In the command line you must have input documents with an extension
> of "xml" since there is no visible way to provide a filter.
>
> 2.The GUI interfaces differently than the command line with the basex
> core since it can receive a filter as well as a path in the database
> creation process
>
> 3.The GUI filter functionality in 6.3.4 is different than in 6.1...for
> me it is "broken" vs. how it works in 6.1
>
> So, I think for my project to work completely, I need new
> functionality: a file name filter that works correctly on the CREATE
> DB statement in the command line interface. Does this sound correct
> to you?
>
> Unfortunately, I don't have control over the extension names of my
> input files as they are created by another piece of software. Until
> I can do a create database in the command line, I'll have to do manual
> gui-based (6.1 version) refreshes of the data or some sort of long
> copy/rename process in the background.
>
> Thanks!
>
> David
>
> DavidEmailSig <mailto:david@leighweb.com>
>
> *From:*Andreas Weiler [mailto:andreas.weiler@uni-konstanz.de]
> *Sent:* Wednesday, December 29, 2010 11:26 AM
> *To:* david(a)leighweb.com; BaseX-Talk(a)mailman.uni-konstanz.de
> *Subject:* Re: [basex-talk] Database creation from a directory tree
>
> Hi David,
>
> the syntax of the create command changed between the releases of 6.1
> and 6.3.4.
>
> In release 6.1 you have to use:
>
> create db C:\Users\David\Documents\OpenSong\songpacks\Songs songs
>
> Kind regards,
> Andreas
>
> Am 28.12.10 18:00, schrieb David leigh:
>
> Here are my command line results from 6.3.4:
>
> C:\Users\David\Documents\OpenSong\OpenSongSearch\BaseX>java -cp
> BaseX.jar org.basex.BaseXClient -Uadmin -Padmin
>
> BaseX 6.3.5 [Client]
>
> Try "help" to get more information.
>
> > drop db songs
>
> Database 'songs' was dropped.
>
> > create db song
>
> Database 'song' created in 1683.61 ms.
>
> > info index
>
> Tags
>
> - Structure: Hash
>
> - Entries: 0
>
> Attributes
>
> - Structure: Hash
>
> - Entries: 0
>
> Text Index
>
> - Structure: Binary tree
>
> - Size: 4 Bytes
>
> - Entries: 0
>
> Attribute Index
>
> - Structure: Binary tree
>
> - Size: 4 Bytes
>
> - Entries: 0
>
> Full-Text Index
>
> - Not available
>
> Path Summary
>
> doc() 1x
>
> > info table
>
> Stopped at line 1, column 10:
>
> Syntax: INFO ([DATABASE|INDEX|STORAGE])
>
> Show information on current database.
>
> Shows information on the currently opened database:
>
> - no argument: show global information
>
> - DATABASE: shows database information
>
> - INDEX: shows index information
>
> - STORAGE [start end] | [query]: show internal database table
>
> > info storage
>
> PRE DIS SIZ ATS NS KIND CONTENT
>
> -------------------------------------
>
> 0 1 1 1 0 DOC song
>
> > info
>
> General Information
>
> Database Path: C:\Users\David\Documents\OpenSong\OpenSongSearch\BaseX\data
>
> Used Main Memory: 895 KB
>
> Database Creation
>
> Whitespace Chopping: ON
>
> Entity Parsing: OFF
>
> Indexes
>
> Path Summary: ON
>
> Text Index: ON
>
> Attribute Index: ON
>
> Full-Text Index: OFF
>
> >
>
> So, for 6.3.4, it creates from the command line, but it's empty. The
> root of that path has NO files in it. The 5861 files are in all the
> subdirectories.
>
> Then, when I try the same syntax with 6.1, I get the following results:
>
> > create db songs C:\Users\David\Documents\OpenSong\songpacks\Songs
>
> Stopped at line 1, column 17:
>
> Syntax: CREATE [DB|COLL|FS|INDEX|USER] [...]
>
> Create database, index or user.
>
> Creates a new database, index or user:
>
> - DB [path] [name?]:
>
> creates the database [name] for the file or directory [path]
>
> - COLL [name]:
>
> creates an empty database [name]
>
> - INDEX [TEXT|ATTRIBUTE|FULLTEXT|PATH]:
>
> creates the specified index
>
> - FS [path] [name] ([mountpoint] [backingstore]):
>
> creates filesystem database [name] for [path]
>
> (using [mountpoint] and [backingstore] if FUSE is activated)
>
> - USER [name] [password?]:
>
> creates the specified user
>
> Summary:
>
> 6.1 GUI -- works as I want it
>
> 6.1 command line -- can't get it to create
>
> 6.3.4 GUI -- creates but with only 14 entries
>
> 6.3.4 command line -- creates, but it's empty
>
> I don't mind staying with 6.1, but I DO want to do everything with the
> command line.
>
> Is the ADD syntax the same, in that I can simply specify the path and
> it will recurse the whole directory tree?
>
> Thanks!!!
>
> David
>
> DavidEmailSig <mailto:david@leighweb.com>
>
> *From:*Andreas Weiler [mailto:andreas.weiler@uni-konstanz.de]
> *Sent:* Tuesday, December 28, 2010 01:29 PM
> *To:* david(a)leighweb.com <mailto:david@leighweb.com>
> *Cc:* basex-talk(a)mailman.uni-konstanz.de
> <mailto:basex-talk@mailman.uni-konstanz.de>
> *Subject:* Re: [basex-talk] Database creation from a directory tree
>
> Additional question: That was in the GUI. I'd like to do the same
> thing using the command line with the .JAR file, but somewhere my
> syntax is not right. Additionally, all the XML files have NO
> EXTENSION so I don't know how to specify that either in the
> command line. So, any help in that area would also be appreciated.
>
>
> Could you provide your syntax?
>
> The syntax should be:
> create db dbname path/to/folder
>
> The missing extension shouldnt be a problem, i just tested it.
>
>
>
> In the GUI in 6.1, I can create a database from a whole directory
> hierarchy of 5,681 individual XML files. When I point to the same
> source file directory and using the 6.3.4 GUI (which I installed with
> a pre-release version of the installer), it only processes 14 files.
> No error message (that I saw) was produced. The behavior that I'm
> wanting is what 6.1 does. Glad to help in solving the problem.
>
> We will check for modifications between the releases. As quick
> workaround you could try to create an empty database and then add the
> documents with the Database/Add documents menu.
>
> Kind regards,
> Andreas
>
> Am 28.12.10 12:55, schrieb David leigh:
>
> I've just installed 6.3.4 and I've noticed a difference from version 6.1.
>
> In the GUI in 6.1, I can create a database from a whole directory
> hierarchy of 5,681 individual XML files. When I point to the same
> source file directory and using the 6.3.4 GUI (which I installed with
> a pre-release version of the installer), it only processes 14 files.
> No error message (that I saw) was produced. The behavior that I'm
> wanting is what 6.1 does. Glad to help in solving the problem.
>
> Additional question: That was in the GUI. I'd like to do the same
> thing using the command line with the .JAR file, but somewhere my
> syntax is not right. Additionally, all the XML files have NO
> EXTENSION so I don't know how to specify that either in the command
> line. So, any help in that area would also be appreciated.
>
> Thank you,
>
> David
>
> DavidEmailSig <mailto:david@leighweb.com>
>
>
>
> _______________________________________________
> BaseX-Talk mailing list
> BaseX-Talk(a)mailman.uni-konstanz.de <mailto:BaseX-Talk@mailman.uni-konstanz.de>
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
[View Less]
Forwarding to the mailing-list...
-------- Original-Nachricht --------
Betreff: Re: [basex-talk] How to retrieve HTTP request parameters and
use them in XQuery with BaseX
Datum: Thu, 30 Dec 2010 13:59:57 +0000
Von: software developer <computer.software.developer(a)gmail.com>
An: Andreas Weiler <andreas.weiler(a)uni-konstanz.de>
Well, then the problem changes to 'how to pass dynamic parameters from
an HTTP client to the java class in question - java class is running on
a …
[View More]different machine' - that bridge was to be the HTTP request parameters
- what else can serve to pass dynamic parameters to the xquery? I
invoke BaseX via jax-rx and xquery is stored on server-side (cannot put
that in the URL itself) - xquery is invoked using run param to jax-rx
invocation.
Your solution has xquery passing the param to the java class, in my case
an external HTTP client is to send the parameters...so, how would the
java class receive the HTTP request param or alternatively, how would
the xquery receive request param directly via jax-rx?
On Thu, Dec 30, 2010 at 1:18 PM, Andreas Weiler
<andreas.weiler(a)uni-konstanz.de <mailto:andreas.weiler@uni-konstanz.de>>
wrote:
Hi,
passing parameters to xquery dynamically can be done with the xquery
java bindings.
So the parameter comes directly from your java class.
[View Less]
Hi,
I get the error:
XPath syntax error at ... in {...get-request-parameter('quer...}:
Cannot find a matching 1-argument function named {
http://orbeon.org/oxf/xml/xforms}get-request-parameter(). *Note: external
function calls have been disabled*
when I attempt to execute a pipeline with:
<p:processor name="oxf:xslt">
<p:input name="config">
<xsl:stylesheet version="2.0">
<xsl:template match="/">
<…
[View More]TargetURL>
<xsl:variable name="location"
select="/Configuration/XMLDB/Location/text()"/>
<xsl:variable name="name"
select="/Configuration/XMLDB/Name/text()"/>
<xsl:variable name="query"
select="xxforms:get-request-parameter('query')"/>
<xsl:value-of
select="fn:concat($location,'/',$name,'?',$query)"/>
</TargetURL>
</xsl:template>
</xsl:stylesheet>
</p:input>
<p:input name="data" href="#configuration"/>
<p:output name="data" id="Target"/>
</p:processor>
Is XPL not the correct location to retrieve the HTTP request params (should
I be doing it in page-flow.xml instead?)
[View Less]
Hi
This topic was mentioned few times before, but it is key aspect of my
application, so I will try anyway.
*Question*:
What is recommended approach for application, where exists multiple document
producers which shall store/modify documents in one, share collection.
*Background*
- Having *feeds*, which might deliver some new messages.
- *Multiple preprocessing processes* - preprocessing the messages before
storing them in collection (Python, celery and RabbitMQ to be ready for
…
[View More]processing bigger amount of incoming messages in parallel)
- Having *single process for write access to my BaseX
collection*(arranging this is not very easy for me so far)
- There are some read only queries for stored messages, there are no
problems with this as it shall be easy to run multiple read-only queries
concurrently.
*Assumptions*
If I am wrong here, please, correct me.
- one collection can be written/modified only by one process at given
moment, other attempts to write are rejected and these attempts will fail.
In other words - one collection can be opened only by one process (or are
multiple opening clients allowed as long as the do not modify database
concurrently?)
- read only queries are easy as they can be run concurrently without
blocking/rejecting
*Current approach*
1. Multiple preprocessing processes are concurrently sending documents
into single basex-storage queue in RabbitMQ
2. There is single one-process worker, consuming documents from queue
basex-storage which does all the work with adding documents for given
collection.
*Wishes*
Managing single write process adds quite complexity to whole solution.
It would be nice, if I can write to single collection by multiple processes
at once and could expect success.
Any comments are welcome
Best regards
Jan
[View Less]
I have a BaseX backed website which stores all the pieces of the page in
the DB. There is a significant amount of processing to be done. Pretty
much any piece of the page can have effective or expiration dates (so
that page parts can come and go on schedule). Some pages have dynamic
elements, such as a Twitter feed. The page is build from objects which
are wrapped in frames (for adding temporal and styling parameters),
which are inserted into columns, which go into rows, which make up a
…
[View More]page (which itself is wrapped in a template). So there is a lot of
recursion.
I do the recursion using local functions.
It works well, but the page-building query is getting enormous, most of
which is all these functions to insert parts of the page, often recursively.
I am wondering what the best practice would be for this. I'm working in
Scala, and I could break the process up into repeated passes hitting the
db with a different query for each, but it seems to me one big query
will almost certainly be faster. But including all the local functions
in the query makes it huge.
Is there some way to compile and load the functions once on startup, and
then just run a small XQuery that calls functions which call functions,
etc.?
Any ideas (or resources) for ways to optimize the query? Everything gets
reused, so there is very little nesting -- mostly references are passed.
For example:
<pages>
<page>
<id>1</id>
<rows>
<row id="2"/>
<row id="3"/>
</rows>
</page>
</pages>
<rows>
<row>
<id>2</id>
<columns>
<column width="18">
<frames>
<frame id="4"/>
<frame id="5"/>
</frames>
</column>
<column width="6">
<frames>
<frame id="6/>
</frames>
</column>
</columns>
</row>
</rows>
<frames>
<frame>
<id>4</id>
<contents>
<content id="7"/>
</contents>
</frame>
</frames>
<contents>
<content type="TEXT"/>
<id>7</id>
<body>
<p>Some text here.</p>
</body>
</content>
<content type="WIDGET"/>
<id>7</id>
<!-- Widget parameters here -->
</content>
</contents>
Thanks!
Chas.
[View Less]
Hi,
eXist DB offers this facility via HTTP related functions:
http://en.wikibooks.org/wiki/XQuery/Checking_for_Required_Parameters
What I want to achieve is pass parameters to XQuery dynamically (not
necessarily by using HTTP request parameters, although that appears to be
one way of achieving this). Is that possible in BaseX; if yes, how?
Thanks.
Hi David,
the syntax of the create command changed between the releases of 6.1 and
6.3.4.
In release 6.1 you have to use:
create db C:\Users\David\Documents\OpenSong\songpacks\Songs songs
Kind regards,
Andreas
Am 28.12.10 18:00, schrieb David leigh:
>
> Here are my command line results from 6.3.4:
>
> C:\Users\David\Documents\OpenSong\OpenSongSearch\BaseX>java -cp
> BaseX.jar org.basex.BaseXClient -Uadmin -Padmin
>
> BaseX 6.3.5 [Client]
>
> Try "help" to …
[View More]get more information.
>
> > drop db songs
>
> Database 'songs' was dropped.
>
> > create db song
>
> Database 'song' created in 1683.61 ms.
>
> > info index
>
> Tags
>
> - Structure: Hash
>
> - Entries: 0
>
> Attributes
>
> - Structure: Hash
>
> - Entries: 0
>
> Text Index
>
> - Structure: Binary tree
>
> - Size: 4 Bytes
>
> - Entries: 0
>
> Attribute Index
>
> - Structure: Binary tree
>
> - Size: 4 Bytes
>
> - Entries: 0
>
> Full-Text Index
>
> - Not available
>
> Path Summary
>
> doc() 1x
>
> > info table
>
> Stopped at line 1, column 10:
>
> Syntax: INFO ([DATABASE|INDEX|STORAGE])
>
> Show information on current database.
>
> Shows information on the currently opened database:
>
> - no argument: show global information
>
> - DATABASE: shows database information
>
> - INDEX: shows index information
>
> - STORAGE [start end] | [query]: show internal database table
>
> > info storage
>
> PRE DIS SIZ ATS NS KIND CONTENT
>
> -------------------------------------
>
> 0 1 1 1 0 DOC song
>
> > info
>
> General Information
>
> Database Path: C:\Users\David\Documents\OpenSong\OpenSongSearch\BaseX\data
>
> Used Main Memory: 895 KB
>
> Database Creation
>
> Whitespace Chopping: ON
>
> Entity Parsing: OFF
>
> Indexes
>
> Path Summary: ON
>
> Text Index: ON
>
> Attribute Index: ON
>
> Full-Text Index: OFF
>
> >
>
> So, for 6.3.4, it creates from the command line, but it's empty. The
> root of that path has NO files in it. The 5861 files are in all the
> subdirectories.
>
> Then, when I try the same syntax with 6.1, I get the following results:
>
> > create db songs C:\Users\David\Documents\OpenSong\songpacks\Songs
>
> Stopped at line 1, column 17:
>
> Syntax: CREATE [DB|COLL|FS|INDEX|USER] [...]
>
> Create database, index or user.
>
> Creates a new database, index or user:
>
> - DB [path] [name?]:
>
> creates the database [name] for the file or directory [path]
>
> - COLL [name]:
>
> creates an empty database [name]
>
> - INDEX [TEXT|ATTRIBUTE|FULLTEXT|PATH]:
>
> creates the specified index
>
> - FS [path] [name] ([mountpoint] [backingstore]):
>
> creates filesystem database [name] for [path]
>
> (using [mountpoint] and [backingstore] if FUSE is activated)
>
> - USER [name] [password?]:
>
> creates the specified user
>
> Summary:
>
> 6.1 GUI -- works as I want it
>
> 6.1 command line -- can't get it to create
>
> 6.3.4 GUI -- creates but with only 14 entries
>
> 6.3.4 command line -- creates, but it's empty
>
> I don't mind staying with 6.1, but I DO want to do everything with the
> command line.
>
> Is the ADD syntax the same, in that I can simply specify the path and
> it will recurse the whole directory tree?
>
> Thanks!!!
>
> David
>
> DavidEmailSig <mailto:david@leighweb.com>
>
> *From:*Andreas Weiler [mailto:andreas.weiler@uni-konstanz.de]
> *Sent:* Tuesday, December 28, 2010 01:29 PM
> *To:* david(a)leighweb.com
> *Cc:* basex-talk(a)mailman.uni-konstanz.de
> *Subject:* Re: [basex-talk] Database creation from a directory tree
>
> Additional question: That was in the GUI. I'd like to do the same
> thing using the command line with the .JAR file, but somewhere my
> syntax is not right. Additionally, all the XML files have NO
> EXTENSION so I don't know how to specify that either in the
> command line. So, any help in that area would also be appreciated.
>
>
> Could you provide your syntax?
>
> The syntax should be:
> create db dbname path/to/folder
>
> The missing extension shouldnt be a problem, i just tested it.
>
>
> In the GUI in 6.1, I can create a database from a whole directory
> hierarchy of 5,681 individual XML files. When I point to the same
> source file directory and using the 6.3.4 GUI (which I installed with
> a pre-release version of the installer), it only processes 14 files.
> No error message (that I saw) was produced. The behavior that I'm
> wanting is what 6.1 does. Glad to help in solving the problem.
>
> We will check for modifications between the releases. As quick
> workaround you could try to create an empty database and then add the
> documents with the Database/Add documents menu.
>
> Kind regards,
> Andreas
>
> Am 28.12.10 12:55, schrieb David leigh:
>
> I've just installed 6.3.4 and I've noticed a difference from version 6.1.
>
> In the GUI in 6.1, I can create a database from a whole directory
> hierarchy of 5,681 individual XML files. When I point to the same
> source file directory and using the 6.3.4 GUI (which I installed with
> a pre-release version of the installer), it only processes 14 files.
> No error message (that I saw) was produced. The behavior that I'm
> wanting is what 6.1 does. Glad to help in solving the problem.
>
> Additional question: That was in the GUI. I'd like to do the same
> thing using the command line with the .JAR file, but somewhere my
> syntax is not right. Additionally, all the XML files have NO
> EXTENSION so I don't know how to specify that either in the command
> line. So, any help in that area would also be appreciated.
>
> Thank you,
>
> David
>
> DavidEmailSig <mailto:david@leighweb.com>
>
>
>
> _______________________________________________
> BaseX-Talk mailing list
> BaseX-Talk(a)mailman.uni-konstanz.de <mailto:BaseX-Talk@mailman.uni-konstanz.de>
> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>
[View Less]
I've just installed 6.3.4 and I've noticed a difference from version 6.1.
In the GUI in 6.1, I can create a database from a whole directory hierarchy
of 5,681 individual XML files. When I point to the same source file
directory and using the 6.3.4 GUI (which I installed with a pre-release
version of the installer), it only processes 14 files. No error message
(that I saw) was produced. The behavior that I'm wanting is what 6.1 does.
Glad to help in solving the problem.
Additional …
[View More]question: That was in the GUI. I'd like to do the same thing
using the command line with the .JAR file, but somewhere my syntax is not
right. Additionally, all the XML files have NO EXTENSION so I don't know
how to specify that either in the command line. So, any help in that area
would also be appreciated.
Thank you,
David
<mailto:david@leighweb.com> DavidEmailSig
[View Less]
Hi, I'm new to basex and NOT a java person at all. I'm creating an
application where a basex database is used to search for song lyrics. I'm
using the autoit3 scripting language in Windows and interfacing to basex
using the basex61.jar on the command line with the output file. I'm
starting the server and then using the client for the queries. So far so
good. The performance is amazing in both loading the database from
thousands of individual XML documents and in querying the database. …
[View More]Quite
pleased.
My desire is to have an app where ALL the components reside in one directory
or its subdirectories. I also want to be able to create and recreate the
basex database programmatically using the CREATE on the command line. I
understand that there exists a basex config file where certain parameters,
like the data store location, can be set, but that the location of this file
is assumed/fixed.i.e. I can't just put it anywhere I want it (like in the
single directory I want this all to reside in). It seems that there are
perhaps actual java commands that I could use when I launch the server
and/or client that would allow me either to specify the location of the
basex config file OR simply pass the parameters that I want to pass for
specifying the location of the database. Unfortunately, none of the
documentation on the site seems to address this level of interaction.
Is there another source of more detailed documentation somewhere or could
someone please guide me in this? I think it all boils down to how to tell
basex, via the command line, where to put the data (for the server) and
where it resides (for the client).
Thank you very much!
<mailto:david@leighweb.com> DavidEmailSig
[View Less]