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 Tue, 11 Oct 2005 15:49:39 GMT
On Tuesday 11 October 2005 02:06, Xavier Vigouroux wrote:
> Let's summarize
>
> 1/ I start the embedded server and wait ping is ok
> 2/ I execute "ij" to boot the DB and create the schema (ij.database has
> a create=true)
>     and I give an SQL file to execute.
>
> at the first line of the execution (some kind of open) , I have a
> priviledgeException
>

Ok,

In step one, I'm making the assumption that you're using the NetworkServer 
framework.
(I say this because I'm using Derby in an embedded app and I don't have to 
start anything.) This goes back to my question about the use of the term 
"embedded server"....

In step 1, you are also using ping() to see if its ok.  I'm going to go out on 
a limb and assume that you mean Net::Ping in a Perl Script?  Again according 
to the man page it doesn't attempt to understand the protocol only that you 
have a live machine and that you can establish a connection to that port.

This goes back to my suggestion of writing a simple java program that in a 
loop will try to establish a connection.

Class foo{
	private int getConnection(){
		int retcd = 1; 
		try{
			// Since I don't know what you
			// are trying to do, I'm going to 
			// assume that you know how to write
			// this in java.
			blah, blah, blah
			// Open the connection
			return retcd;
		}
		catch (Exception e){
			// doesn't matter if anything is thrown
			// You can print the exception
			retcd = 0;
			return retcd;
                }
         }

	public void main(){
		int retcd = 0; // 
		while (retcd == 1){
			retcd = getConnection();
		}
	}
}

Ok some notes:
1) Since I don't know your app, I'm going to assume that you've either 
hardcoded certain properties, or if you're doing this in a shellscript or 
perl script, you can write those properties to a file. 

This is why I don't have enough information to give you more detail on how to 
write a connection. 


2) This is a really, really simple thing to write. 
In the main, all you are doing is looping until you get a good connection.
Note that I should have used a finally block to return the retcd. But hey, I'm 
being lazy and in this example, its more obvious at what I want to do. ;-)

3) I'm old school. This is why the main method is at the end of the class def.
		
Does this make sense?

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

Mime
View raw message