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 '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@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
Hi Ivan,
Steps:
- 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.
So, if I got it right, your Java application wasn't communicating with the BaseX server instance from 1? – In fact, the standalone and client/server mode should never be mixed. Some time ago, we played around with global locking mechanisms to avoid access to databases that are currently opened by a server instance; we might reintroduce this one day to prevent cases like yours.
If you're only working with clients accessing the same server instance, however, you shouldn't encounter any problems. If I'm wrong, this would be sth. we should have another look at.
- Then I forgot to reopen terminal client and used the one that I opened in
Step 1.
...indeed that's completely ok – Step 2 should rather be avoided (if it didn't access the server from 1, as I mentioned above)
Hope this helps, Christian
- Run optimize command for the collection and got error.
- Cannot open the collection any more as I'm getting '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@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
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Christian,
You're totally right. My Java application didn't communicate with the running BaseX server. That's the cause of problem. However, it'd be great to have global locking mechanisms or at least an ability to erase existing indexes that are causing 'Out of memory' without opening broken database.
Best regards, Ivan Lagunov
On 10/28/2010 03:34 PM, Christian Grün wrote:
Hi Ivan,
Steps:
- 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.
So, if I got it right, your Java application wasn't communicating with the BaseX server instance from 1? – In fact, the standalone and client/server mode should never be mixed. Some time ago, we played around with global locking mechanisms to avoid access to databases that are currently opened by a server instance; we might reintroduce this one day to prevent cases like yours.
If you're only working with clients accessing the same server instance, however, you shouldn't encounter any problems. If I'm wrong, this would be sth. we should have another look at.
- Then I forgot to reopen terminal client and used the one that I opened in
Step 1.
...indeed that's completely ok – Step 2 should rather be avoided (if it didn't access the server from 1, as I mentioned above)
Hope this helps, Christian
- Run optimize command for the collection and got error.
- Cannot open the collection any more as I'm getting '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@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
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi: the BaseX UI provide a Path Summary tab in the database file properties from where I can export the underlying XML. Can this XML be retrieved directly in a xquery statement (I assume as a basex: function)? Otherwise from Java? thanks *P
Hi Pascal,
i dont know about xquery but in Java you can do the following...
Context ctx = new Context(); try { new Open("Database").execute(ctx); System.out.println(Token.string(ctx.data.info(IndexType.PATH))); } catch(Exception e) { e.printStackTrace(); }
Kind regards, Andreas
Am 28.10.2010 19:38, schrieb Pascal Heus:
Hi: the BaseX UI provide a Path Summary tab in the database file properties from where I can export the underlying XML. Can this XML be retrieved directly in a xquery statement (I assume as a basex: function)? Otherwise from Java? thanks *P
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
Hi Pascal,
you might also use the (undocumented) database command "info index path" to get a plain text representation of the path index. It's a good idea to offer additional basex functions for database meta data; I've put this on our list.
Best, Christian
On Thu, Oct 28, 2010 at 8:06 PM, Andreas Weiler andreas.weiler@uni-konstanz.de wrote:
Hi Pascal,
i dont know about xquery but in Java you can do the following...
Context ctx = new Context(); try { new Open("Database").execute(ctx); System.out.println(Token.string(ctx.data.info(IndexType.PATH))); } catch(Exception e) { e.printStackTrace(); }
Kind regards, Andreas
Am 28.10.2010 19:38, schrieb Pascal Heus:
Hi: the BaseX UI provide a Path Summary tab in the database file properties from where I can export the underlying XML. Can this XML be retrieved directly in a xquery statement (I assume as a basex: function)? Otherwise from Java? thanks *P
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
Chritsian: Thanks for the tip. BTW, in the generated XML, it would also be useful to have the element namespace (if this is available). best Pascal
On 10/29/10 3:10 AM, Christian Grün wrote:
Hi Pascal,
you might also use the (undocumented) database command "info index path" to get a plain text representation of the path index. It's a good idea to offer additional basex functions for database meta data; I've put this on our list.
Best, Christian
On Thu, Oct 28, 2010 at 8:06 PM, Andreas Weiler andreas.weiler@uni-konstanz.de wrote:
Hi Pascal,
i dont know about xquery but in Java you can do the following...
Context ctx = new Context(); try { new Open("Database").execute(ctx); System.out.println(Token.string(ctx.data.info(IndexType.PATH))); } catch(Exception e) { e.printStackTrace(); }
Kind regards, Andreas
Am 28.10.2010 19:38, schrieb Pascal Heus:
Hi: the BaseX UI provide a Path Summary tab in the database file properties from where I can export the underlying XML. Can this XML be retrieved directly in a xquery statement (I assume as a basex: function)? Otherwise from Java? thanks *P
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
Christian: Reviving an old question.... Was the "info index path" command ever turned into an xquery function? Don't seem to see an equivalent in http://docs.basex.org/wiki/Index_Module thanks *P
On 10/29/10 9:10 AM, Christian Grün wrote:
Hi Pascal,
you might also use the (undocumented) database command "info index path" to get a plain text representation of the path index. It's a good idea to offer additional basex functions for database meta data; I've put this on our list.
Best, Christian
On Thu, Oct 28, 2010 at 8:06 PM, Andreas Weiler andreas.weiler@uni-konstanz.de wrote:
Hi Pascal,
i dont know about xquery but in Java you can do the following...
Context ctx = new Context(); try { new Open("Database").execute(ctx); System.out.println(Token.string(ctx.data.info(IndexType.PATH))); } catch(Exception e) { e.printStackTrace(); }
Kind regards, Andreas
Am 28.10.2010 19:38, schrieb Pascal Heus:
Hi: the BaseX UI provide a Path Summary tab in the database file properties from where I can export the underlying XML. Can this XML be retrieved directly in a xquery statement (I assume as a basex: function)? Otherwise from Java? thanks *P
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
Hi Pascal,
you are probably looking for the index:facets function. I have slightly revamped the Wiki page to make the relationship more obvious.
Christian ______________________________
2013/7/31 Pascal Heus pascal.heus@gmail.com:
Christian: Reviving an old question.... Was the "info index path" command ever turned into an xquery function? Don't seem to see an equivalent in http://docs.basex.org/wiki/Index_Module thanks *P
On 10/29/10 9:10 AM, Christian Grün wrote:
Hi Pascal,
you might also use the (undocumented) database command "info index path" to get a plain text representation of the path index. It's a good idea to offer additional basex functions for database meta data; I've put this on our list.
Best, Christian
On Thu, Oct 28, 2010 at 8:06 PM, Andreas Weiler andreas.weiler@uni-konstanz.de wrote:
Hi Pascal,
i dont know about xquery but in Java you can do the following...
Context ctx = new Context(); try { new Open("Database").execute(ctx); System.out.println(Token.string(ctx.data.info(IndexType.PATH))); } catch(Exception e) { e.printStackTrace(); }
Kind regards, Andreas
Am 28.10.2010 19:38, schrieb Pascal Heus:
Hi: the BaseX UI provide a Path Summary tab in the database file properties from where I can export the underlying XML. Can this XML be retrieved directly in a xquery statement (I assume as a basex: function)? Otherwise from Java? thanks *P
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
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de