Re: Java Multithreaded application gives -1 as PID
Posted in 2008
On Tue, 2008-02-19 at 08:51 -0800, mohitanchlia@gmail.com wrote:
> On Feb 18, 2:08 pm, Fernando Nunes <s...@onlinedomus.net> wrote:
> > jpren...@yahoo.com wrote:
> > > On Feb 18, 3:22 pm, jpren...@yahoo.com wrote:
> > >> On Feb 18, 3:01 pm, mohitanch...@gmail.com wrote:
> >
> > >>> Version: IDS 10
> > >>> I have a java application that is multithreaded and each thread
> > >>> creates a new DB connection. But when I look at onstat -g ses I see
> > >>> PID as -1. Could somebody tell me if this could be changed to reflect
> > >>> actual PID of the application ?
> > >> Where is the application connecting from? Is it connecting from a
> > >> remote machine or local to the database server? If it's a remote
> > >> machine, if I remember correctly, that is why the PID gets set to -1,
> > >> and only local network connections and local shared memory connections
> > >> have valid PIDs.
> >
> > > Hmm, doing a quick tests between machines and I was able to get a
> > > remote network connection to show up with a valid PID. It seems like
> > > that used to be the case, I'll see about doing more checking to see
> > > what the PID of -1 means now.
> >
> > AFAIK, PIS -1 happens always with Java applications... I didn't test it, but
> > that's what I'm used to see. I have no idea if there is any valid reason for
> > this... like some technical difficulty for the client libraries to find out the
> > process that are running them...
> >
> > --
> > Fernando Nunes
> > Portugal
> >
> > http://informix-technology.blogspot.com
> > My email works... but I don't check it frequently...- Hide quoted text -
> >
> > - Show quoted text -
>
> Yes. All java applications show PID as -1. However, ESQL/C
> applications show PID correctly. Is there a way to get the correct PID
> information to Informix for Java Applications ?
> _______________________________________________
> Informix-list mailing list
> Informix-list@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
I have the distinct feeling that you won't be able to do this with a
pure java application/driver. Obtaining the PID of a running
application and the value itself happens to be one of those things that
is not going to translate well from platform to platform. AFAIK there
isn't a reliable way in java to get that kind of information . . .
--
--------------------------------------------
Chris Salch
Programmer/Analyst
LeTourneau University