db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kim Haase (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4525) Document the in-memory storage back end
Date Fri, 12 Mar 2010 21:35:27 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844696#action_12844696

Kim Haase commented on DERBY-4525:

Well, the wrong-format error message may not be that serious an issue. But it does seem to
be the case that you can drop an on-disk database, at least if you create it in a directory
called "memory".

I (accidentally, because of a punctuation error) create a db called myDB in the directory

ij> connect 'jdbc:derby://localhost:1527/memory/myDB;create=true';
ij> create table t(c int);
0 rows inserted/updated/deleted

The database is visible in the file system:


log/                 seg0/                service.properties


log/                 seg0/                service.properties

The database is actually there:

ls ~/DERBYTUTOR/memory/myDB
db.lck               log/                 service.properties
dbex.lck             seg0/                tmp/

I am then able to drop this database even though it's a file system db:

ij> connect 'jdbc:derby://localhost:1527/memory/myDB;drop=true';
ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'memory/myDB'

The database is gone:


log/                 seg0/                service.properties


log/                 seg0/                service.properties

I then try to drop another filesystem db, one that doesn't have "memory" in the name. This
fails, as it should:

ij> connect 'jdbc:derby://localhost:1527/seconddb;drop=true';
ERROR XBM0I: DERBY SQL error: SQLCODE: -1, SQLSTATE: XBM0I, SQLERRMC: Directory seconddb cannot
be removed.

I then use the correct syntax to create the in-memory db. It is created, but in a new connection.

ij> connect 'jdbc:derby://localhost:1527/memory:myDB;create=true';
ij(CONNECTION1)> show connections;
CONNECTION0 -   jdbc:derby://localhost:1527/memory/myDB;create=true
CONNECTION1* -  jdbc:derby://localhost:1527/memory:myDB;create=true
* = current connection

I find that if I start over and create the filesystem db, I can shut it down and it stays

ij> connect 'jdbc:derby://localhost:1527/memory/myDB;create=true';
ij> connect 'jdbc:derby://localhost:1527/memory/myDB;shutdown=true';
ERROR 08006: DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'memory/myDB'

ls ~/DERBYTUTOR/memory

This is as it should be. I shouldn't be able to drop it, though.

> Document the in-memory storage back end
> ---------------------------------------
>                 Key: DERBY-4525
>                 URL: https://issues.apache.org/jira/browse/DERBY-4525
>             Project: Derby
>          Issue Type: Task
>          Components: Documentation
>    Affects Versions:
>            Reporter: Kristian Waagan
>            Assignee: Kim Haase
>             Fix For:
> The in-memory back end isn't considered experimental anymore, we have to 
> write user documentation for the feature(s).
> I'm not  sure how it should be structured, and where the content should be added.
> Just as a rough cut, here are a few possible topics (I'm not sure if all should be included
or not):
> - documenting the new protocol name ('memory')
> - documenting the new 'drop' JDBC connection URL attribute
> - describing the limitations of the feature (all your data will be lost if..., how to
use it with the client driver and the data sources)
> - "advanced use" (pull dbs on disk into memory, backup in-memory dbs to disk)
> - tuning tips (there are some issues with extreme page cache sizes, maybe the existing
content on page size is valid)
> - known problems (nothing concrete here yet, but we have one inquiry about disappearing
databases - the current theory is that different class loaders are used)
> Some more information is available at http://wiki.apache.org/db-derby/InMemoryBackEndPrimer

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message