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 Thu, 06 Oct 2005 16:08:34 GMT
On Thursday 06 October 2005 04:41, Xavier Vigouroux wrote:
> >
> > You're doing this in a shell script?
> yes.
> > 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.
> no, IJ is creating the DB. and It creates it after the ping() has
> returned ok.
> The real problem is that the ping() returns before the connection can
> be accepted. This is the root problem.
> do you agree?
I think that there may be an issue with your design. But I don't know enough 
(I'm not really keen on IJ. I guess since I'm working with Derby as an 
embedded db, eclipse has a better interface for what I need. ;-)


> PS: In my design, there is a big separation between the server and the
> user of derby. And the server
> indicates it is ready if and only if it is effectively ready....

I'm still a little confused on what you're trying to do...

Something is being lost in translation.

It sounds like you're trying to start a derby database using the NetworkServer 
framework, then once it is up, you want to then create a schema using IJ?

That is you're running IJ only once against a remote database?

And the problem that you run in to is that ping() will say that the network 
listeners are up and running but the actual database may not yet available?

If thats the case then yes, you'd want to write a simple java app to replace 

No you're not going to create a test schema.

Here's the logic.

In your main() {
	int retcd =0;

	while (retcd ==0) {
		retcd = tryConnection();

In your tryConnection() method:

public static int tryConnection(){
	int retcd =0;
		blah blah blah
		Connection con = ...
		retcd = 1;
	Catch (exception e)
		retcd =  0;

Well you get the idea.

The point is that if you can get a connection to the database, then you should 
be able to run ij to create the schema.

I was saying that if you *really* want to be *anal*, you could do a secondary 
loop to be sure...

That is to do a query against SYS.SYSSCHEMAS.

If the database is truly up and running, you should be able to get a result 

But that's being paranoid. 
I believe being able to establish a connection to the database should be 
enough to ensure that its up and running.

So what am I missing? Besides half a bottle of Vodka that was full sometime 
the night before along with any sort of memory of what happend past 9:00 
pm.... ;-)

Michael Segel
(312) 952-8175

View raw message