db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael J. Segel" <mse...@segel.com>
Subject Re: transient priviledgeException
Date Wed, 05 Oct 2005 16:49:08 GMT
On Wednesday 05 October 2005 10:44, Xavier Vigouroux wrote:
> Le 4 oct. 05, à 23:27, Øystein Grøvlen a écrit :
> >>>>>> "XV" == Xavier Vigouroux <Xavier-Francois.Vigouroux@Sun.COM>
> >>>>>> writes:
> >
> >     XV> Hi,
> >     XV> I have a transient priviledgeException  when connection to the
> > DB with
> >     XV> ij.
> >
> >
> >     XV> here is the scenario:
> >
> >     XV>   1/ I start an embeddedServer
> >     XV>   2/ wait for the ping() be ok (tested in the JVM creating the
> > server)
> >     XV>   3/ start ij to create a schema.
> >
> >     XV> then in 4, I get a transient error...i.e if I retry it works.
> >
> >     XV> what should I wait for to be sure the server is ready to
> > recieve cmd?
> >
> > I checked the implementation of ping(), and it seems to only check
> > that it is able to get in touch with the network server.  It does not
> > try to get a connection to a database.  Does anyone have any
> > suggestion for how Xavier can determine that the server is ready to
> > create a database?
>
> hi,
>
> This is really important for me to have a clear condition about the
> state of the server.
> making a sleep 10 is not convincing anybody
>
> thanks
>
Silly me.

You're doing this in a shell script?
So when you start derby your command forks a seperate process, hence IJ gets 
started prior to the completion of the creation of the base database.

Simple solution.

Write a simple Java App that will in a loop attempt to get a connection to the 
database. Once you succeed to get a connection, you exit and then go on with 
your script. If you want to be really, really sure, you can always do a query 
against something in the SYS schema.

(Its a Bart Simpson type of app. "Are we there yet?"...)

This should cause enough of a delay that when you run IJ you don't get your 
exception.

No?

> > --
> > Øystein

-- 
Michael Segel
Principal
MSCC
(312) 952-8175

Mime
View raw message