You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Antonio Goncalves <an...@gmail.com> on 2008/09/16 10:47:12 UTC

Just in memory ?

Hi,
I'm using the Derby network database to run my application and the Embedded
mode for testing. Both work fine. But when I use the Embedded mode, Derby
creates a directory on my hard drive full or files. I would like just to
have a in-memory database, no I/O, just in-memory. Is it possible with Derby
?  This is what I have at the moment :

<persistence-unit name="jolorunSampleJpaPU">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <class>org.jolorun.samples.jpa.basic.Customer</class>
        <properties>
            <property name="eclipselink.jdbc.driver"
value="org.apache.derby.jdbc.EmbeddedDriver"/>
            <property name="eclipselink.jdbc.url"
value="jdbc:derby:myDB;create=true" />
            <property name="eclipselink.jdbc.user" value="APP" />
            <property name="eclipselink.jdbc.password" value="APP" />
            <property name="eclipselink.ddl-generation"
value="drop-and-create-tables" />
        </properties>
    </persistence-unit>
</persistence>


I've seen a very old thread (
http://mail-archives.apache.org/mod_mbox/db-derby-dev/200510.mbox/%3C4364E8D3.9030702@sbcglobal.net%3E)
that mentions the URL jdbc:derby:memory:myDb but that doesn't work. I've
cheked out the Derby source code but didn't find anything about that.

Any idea ?

Thanks,

Antonio

Re: Just in memory ?

Posted by Antonio Goncalves <an...@gmail.com>.
Well, it's a bit of a shame...
Thanks Knut for this quick reply and for the link.

Antonio

2008/9/16 Knut Anders Hatlen <Kn...@sun.com>

> Antonio Goncalves <an...@gmail.com> writes:
>
> > Hi,
> >
> > I'm using the Derby network database to run my application and the
> Embedded
> > mode for testing. Both work fine. But when I use the Embedded mode, Derby
> > creates a directory on my hard drive full or files. I would like just to
> have
> > a in-memory database, no I/O, just in-memory. Is it possible with Derby ?
>
> Hi Antonio,
>
> I'm afraid that's not possible with Derby at the moment. This feature
> has been requested by others as well. See these issues in the bug
> tracker:
>
> https://issues.apache.org/jira/browse/DERBY-646
> https://issues.apache.org/jira/browse/DERBY-2798
>
> There hasn't been any activity in any of these issues for quite a while,
> though.
>
> > I've seen a very old thread (http://mail-archives.apache.org/mod_mbox/
> > db-derby-dev/200510.mbox/%3C4364E8D3.9030702@sbcglobal.net%3E) that
> mentions
> > the URL jdbc:derby:memory:myDb but that doesn't work. I've cheked out the
> > Derby source code but didn't find anything about that.
>
> I think you need the patch from DERBY-646 to get this to work.
>
> --
> Knut Anders
>



-- 
--
Antonio Goncalves (antonio.goncalves@gmail.com)
Software architect

Paris JUG leader : www.parisjug.org
Web site : www.antoniogoncalves.org
Blog: jroller.com/agoncal
LinkedIn: www.linkedin.com/in/agoncal

Re: Just in memory ?

Posted by Knut Anders Hatlen <Kn...@Sun.COM>.
Antonio Goncalves <an...@gmail.com> writes:

> Hi,
>
> I'm using the Derby network database to run my application and the Embedded
> mode for testing. Both work fine. But when I use the Embedded mode, Derby
> creates a directory on my hard drive full or files. I would like just to have
> a in-memory database, no I/O, just in-memory. Is it possible with Derby ?

Hi Antonio,

I'm afraid that's not possible with Derby at the moment. This feature
has been requested by others as well. See these issues in the bug
tracker:

https://issues.apache.org/jira/browse/DERBY-646
https://issues.apache.org/jira/browse/DERBY-2798

There hasn't been any activity in any of these issues for quite a while,
though.

> I've seen a very old thread (http://mail-archives.apache.org/mod_mbox/
> db-derby-dev/200510.mbox/%3C4364E8D3.9030702@sbcglobal.net%3E) that mentions
> the URL jdbc:derby:memory:myDb but that doesn't work. I've cheked out the
> Derby source code but didn't find anything about that.

I think you need the patch from DERBY-646 to get this to work.

-- 
Knut Anders

Re: Just in memory ?

Posted by Peter Ondruška <pe...@gmail.com>.
Dear Antonio,

you do not mention what OS you run your Derby on but in case you are on Unix
they provide workaround to your requested feature already. For example by
default on all Solaris you have /tmp mounted as tmpfs in swap which is in
memory.

Hopefully this helps to you or others.

Peter

On Tue, Sep 16, 2008 at 10:47 AM, Antonio Goncalves <
antonio.mailing@gmail.com> wrote:

> Hi,
> I'm using the Derby network database to run my application and the Embedded
> mode for testing. Both work fine. But when I use the Embedded mode, Derby
> creates a directory on my hard drive full or files. I would like just to
> have a in-memory database, no I/O, just in-memory. Is it possible with Derby
> ?  This is what I have at the moment :
>
> <persistence-unit name="jolorunSampleJpaPU">
>
>  <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>         <class>org.jolorun.samples.jpa.basic.Customer</class>
>         <properties>
>             <property name="eclipselink.jdbc.driver"
> value="org.apache.derby.jdbc.EmbeddedDriver"/>
>             <property name="eclipselink.jdbc.url"
> value="jdbc:derby:myDB;create=true" />
>             <property name="eclipselink.jdbc.user" value="APP" />
>             <property name="eclipselink.jdbc.password" value="APP" />
>             <property name="eclipselink.ddl-generation"
> value="drop-and-create-tables" />
>         </properties>
>     </persistence-unit>
> </persistence>
>
>
> I've seen a very old thread (
> http://mail-archives.apache.org/mod_mbox/db-derby-dev/200510.mbox/%3C4364E8D3.9030702@sbcglobal.net%3E)
> that mentions the URL jdbc:derby:memory:myDb but that doesn't work. I've
> cheked out the Derby source code but didn't find anything about that.
>
> Any idea ?
>
> Thanks,
>
> Antonio
>
>