RE: [JDBC] jdbc and unix signals

2001-07-11 Thread Peter Eisentraut

Nikk Anderson writes:

> You can catch OS signals in java, although there are different signals for
> each OS.  The following packages have signal functionality: sun.misc.Signal,
> sun.misc.SignalHandler.

The JDBC driver doesn't use these.

-- 
Peter Eisentraut   [EMAIL PROTECTED]   http://funkturm.homeip.net/~peter


---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



Re: [JDBC] jdbc and unix signals

2001-07-11 Thread Peter Eisentraut

Nikk Anderson writes:

> Does the postgres driver catch the signals, thus overiding my attempts to
> catch them?

You can't catch signals in Java, because not all systems have signals.
You might be able to write native methods to do so, but consider
reconsidering your design.

-- 
Peter Eisentraut   [EMAIL PROTECTED]   http://funkturm.homeip.net/~peter


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



RE: [JDBC] jdbc and unix signals

2001-07-11 Thread Nikk Anderson
Title: RE: [JDBC] jdbc and unix signals





Hi, 


Peter Eisentraut writes:
>You can't catch signals in Java, because not all systems have signals.
>You might be able to write native methods to do so, but consider
>reconsidering your design.


You can catch OS signals in java, although there are different signals for each OS.  The following packages have signal functionality: sun.misc.Signal, sun.misc.SignalHandler.

I have created test programs which can handle various signals sucessfully - and it is these test programs which work (i.e. catch signals) when no jdbc driver is loaded, and do not when the driver is loaded.

Check out the following url for a discussion about signals.
http://forums.java.sun.com/thread.jsp?forum=37&thread=70586


Cheers


Nikk





[JDBC] jdbc and unix signals

2001-07-11 Thread Nikk Anderson
Title: jdbc and unix signals





Hi, 


I am using the postgres jdbc which was compiled on Solaris as part of the postgres 7.1 installation.


I have a program which runs as a deamon, and connects to postgres for data.  As it is running as a deamon, we have included some signal handling routines.  We are trying to trap HUP (kill -1)  signals, so that the process will not exit when that signal is sent.  

If the program uses the jdbc driver, then the program can not catch the HUP signal - however, if we do NOT use the jdbc at all, then we can trap the signal and deal with it as we wish.

Does the postgres driver catch the signals, thus overiding my attempts to catch them?


Any ideas


Thanks


Nikk Anderson