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 Ivan Ooi <ol...@gmail.com> on 2007/07/07 05:07:19 UTC

Any problems to run derby in USB drive ?

Hi all,

   I wanted to deploy my App with Derby in USB drive but I'm not sure is
there any restrictions or not ? or problems ?

Thanks

Re: Any problems to run derby in USB drive ?

Posted by V....@Sun.COM.
V.Narayanan@Sun.COM wrote:

> Ivan Ooi wrote:
>
>> Hi all,
>>
>>    I wanted to deploy my App with Derby in USB drive but I'm not sure 
>> is there any restrictions or not ? or problems ?
>>
>> Thanks
>
>
> Hi,
>
> I have tried copying the jre(for the operating system of the machine 
> into which you will plug in the USB drive),
> derby.jar, derbytools.jar into a USB and tried to create a database, 
> create tables, insert data etc, and it worked
> fine for me.
>
> I noticed it was a bit slow, possible because it is doing IO to the 
> USB disk.
>
> I used my creative muvo mp3 player which also doubles up as  USB.
>
> I haven't tried any serious testing though.
>
> I just did it as a casual exercise.
>
> Narayanan
>
I did something a little bit more interesting. I had two machines one 
running
solaris and another linux. I copied derby.jar, derbytools.jar and the 
jre's for both the
OS in my USB. I created the database and the tables in one OS, shutdown 
the database
and tried opening it in another OS. I tried it both ways

create in solaris, open in linux
create in linux, open solaris.

It worked fine in this case.

As mentioned earlier I did not do any serious testing.

While doing this you just have to remember to boot the database
each time with the appropriate jre inside the USB.

I thought it would be interesting if I could find a mechanism by which I
could choose the correct jre automatically, but never got to doing that.

Thought this information might be useful to you,

Narayanan

Re: Any problems to run derby in USB drive ?

Posted by V....@Sun.COM.
Ivan Ooi wrote:

> Hi all,
>
>    I wanted to deploy my App with Derby in USB drive but I'm not sure 
> is there any restrictions or not ? or problems ?
>
> Thanks

Hi,

I have tried copying the jre(for the operating system of the machine 
into which you will plug in the USB drive),
derby.jar, derbytools.jar into a USB and tried to create a database, 
create tables, insert data etc, and it worked
fine for me.

I noticed it was a bit slow, possible because it is doing IO to the USB 
disk.

I used my creative muvo mp3 player which also doubles up as  USB.

I haven't tried any serious testing though.

I just did it as a casual exercise.

Narayanan


Re: Any problems to run derby in USB drive ?

Posted by Ivan Ooi <ol...@gmail.com>.
Hi Narayanan,

  oh sorry, it should be embedded with network server. not "type". basically
database server and application running on same VM... Hope I'm make it
clear.

thanks

On 7/19/07, V.Narayanan@sun.com <V....@sun.com> wrote:
>
> Hi Ivan,
>
> What is implied by "database as an embedded with network type" ?
>
> Narayanan
>
> Ivan Ooi wrote:
>
> > Thanks Daniel,
> >
> >   Basically I just include swt.jar together with my application. since
> > every things are store inside the USB drive. so far so good. Now I
> > make the database as an embedded with network type. start only when
> > application start.
> >
> > Thanks :-)
> >
> > On 7/16/07, *Daniel Noll* <daniel@nuix.com <ma...@nuix.com>>
> > wrote:
> >
> >     On Friday 13 July 2007 02:57:44 Ivan Ooi wrote:
> >     > ya sure. :-D well... nothing much, I will use SWT system tray
> >     control to do
> >     > the job... hopefully it work. :-D
> >
> >     Might also be worth looking at java.awt.TrayIcon , so if the
> >     system has Java 6
> >     or later the person isn't forced to install SWT. :-)
> >
> >     Daniel
> >
> >
> >     --
> >     Daniel Noll
> >     Nuix Pty Ltd
> >     Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2
> >     9280 0699
> >     Web: http://nuix.com/                               Fax: +61 2
> >     9212 6902
> >
> >
>
>

Re: Any problems to run derby in USB drive ?

Posted by V....@Sun.COM.
Hi Ivan,

What is implied by "database as an embedded with network type" ?

Narayanan

Ivan Ooi wrote:

> Thanks Daniel,
>
>   Basically I just include swt.jar together with my application. since 
> every things are store inside the USB drive. so far so good. Now I 
> make the database as an embedded with network type. start only when 
> application start.
>
> Thanks :-)
>
> On 7/16/07, *Daniel Noll* <daniel@nuix.com <ma...@nuix.com>> 
> wrote:
>
>     On Friday 13 July 2007 02:57:44 Ivan Ooi wrote:
>     > ya sure. :-D well... nothing much, I will use SWT system tray
>     control to do
>     > the job... hopefully it work. :-D
>
>     Might also be worth looking at java.awt.TrayIcon , so if the
>     system has Java 6
>     or later the person isn't forced to install SWT. :-)
>
>     Daniel
>
>
>     --
>     Daniel Noll
>     Nuix Pty Ltd
>     Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2
>     9280 0699
>     Web: http://nuix.com/                               Fax: +61 2
>     9212 6902
>
>


Re: Any problems to run derby in USB drive ?

Posted by Ivan Ooi <ol...@gmail.com>.
Thanks Daniel,

  Basically I just include swt.jar together with my application. since every
things are store inside the USB drive. so far so good. Now I make the
database as an embedded with network type. start only when application
start.

Thanks :-)

On 7/16/07, Daniel Noll <da...@nuix.com> wrote:
>
> On Friday 13 July 2007 02:57:44 Ivan Ooi wrote:
> > ya sure. :-D well... nothing much, I will use SWT system tray control to
> do
> > the job... hopefully it work. :-D
>
> Might also be worth looking at java.awt.TrayIcon, so if the system has
> Java 6
> or later the person isn't forced to install SWT. :-)
>
> Daniel
>
>
> --
> Daniel Noll
> Nuix Pty Ltd
> Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
> Web: http://nuix.com/                               Fax: +61 2 9212 6902
>

Re: Any problems to run derby in USB drive ?

Posted by Daniel Noll <da...@nuix.com>.
On Friday 13 July 2007 02:57:44 Ivan Ooi wrote:
> ya sure. :-D well... nothing much, I will use SWT system tray control to do
> the job... hopefully it work. :-D

Might also be worth looking at java.awt.TrayIcon, so if the system has Java 6 
or later the person isn't forced to install SWT. :-)

Daniel


-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

Re: Any problems to run derby in USB drive ?

Posted by Ivan Ooi <ol...@gmail.com>.
ya sure. :-D well... nothing much, I will use SWT system tray control to do
the job... hopefully it work. :-D

On 7/12/07, Francois Orsini <fr...@gmail.com> wrote:
>
> Cool - let us know how it develops and how your application pans out at
> the end - This sounds quite interesting Ivan.
>
> On 7/11/07, Ivan Ooi < olibralo@gmail.com> wrote:
> >
> > wow! Thanks guys! you guys did a lot of test on this as well. Look like
> > I need to make sure user shut down the database properly before USB removed
> > from machine....
> > I'm thinking to create a derby starter using system tray style....
> >
> > Thanks guys.
> >
>
>

Re: Any problems to run derby in USB drive ?

Posted by Francois Orsini <fr...@gmail.com>.
Cool - let us know how it develops and how your application pans out at the
end - This sounds quite interesting Ivan.

On 7/11/07, Ivan Ooi <ol...@gmail.com> wrote:
>
> wow! Thanks guys! you guys did a lot of test on this as well. Look like I
> need to make sure user shut down the database properly before USB removed
> from machine....
> I'm thinking to create a derby starter using system tray style....
>
> Thanks guys.
>

Re: Any problems to run derby in USB drive ?

Posted by Ivan Ooi <ol...@gmail.com>.
wow! Thanks guys! you guys did a lot of test on this as well. Look like I
need to make sure user shut down the database properly before USB removed
from machine....
I'm thinking to create a derby starter using system tray style....

Thanks guys.

Re: Any problems to run derby in USB drive ?

Posted by Mike Matrigali <mi...@sbcglobal.net>.
This leads me to believe that these drives are not correctly supporting
sync to disk as required by derby.  Derby uses java to sync the data and
log files when necessary.  If the devices don't correctly respond to
these requests then a number of different types of corruption:
checksum errors
mismatched index/base tables because log and data syncing not correctly 
coordinated
...

My guess is that device driver for the usb device responds to a write
sync immediately before actually forcing the data to the device.  This
is similar to the problem of setting "write cache enabled" on windows.
Derby can not guarantee a consistent database under these conditions.

/mikem

Francois Orsini wrote:
> Ivan,
> 
> If you decide to run your application from an USB drive, try to make 
> sure it is *unmount'ed* (on Unix) or software-safely removed on Windows 
> properly, to ensure all data has been flushed to the USB drive. I have 
> seen file checksum/corruption issues occasionally where removing a drive 
> right after completing writes on it...Maybe something you can test as 
> part of your application and on the targeted platforms.
> 
> --francois
> 
> On 7/6/07, *Ivan Ooi* <olibralo@gmail.com <ma...@gmail.com>> 
> wrote:
> 
>     Hi all,
> 
>        I wanted to deploy my App with Derby in USB drive but I'm not
>     sure is there any restrictions or not ? or problems ?
> 
>     Thanks
> 
> 

Re: Any problems to run derby in USB drive ?

Posted by Francois Orsini <fr...@gmail.com>.
Ivan,

If you decide to run your application from an USB drive, try to make sure it
is *unmount'ed* (on Unix) or software-safely removed on Windows properly, to
ensure all data has been flushed to the USB drive. I have seen file
checksum/corruption issues occasionally where removing a drive right after
completing writes on it...Maybe something you can test as part of your
application and on the targeted platforms.

--francois

On 7/6/07, Ivan Ooi <ol...@gmail.com> wrote:
>
> Hi all,
>
>    I wanted to deploy my App with Derby in USB drive but I'm not sure is
> there any restrictions or not ? or problems ?
>
> Thanks
>