Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Java threads & deamons

Re: Java threads & deamons

From: Robert Klemme <bob.news_at_gmx.net>
Date: Thu, 6 May 2004 12:04:14 +0200
Message-ID: <2fugt0F2915aU1@uni-berlin.de>

"the spammers have won :-(" <"the spammers have won :-("> schrieb im Newsbeitrag news:4099e746$1_at_news.012.net.il...
> AlexLi wrote:
> > Hi.
> >
> > We are trying to make a "batch" execution in a Oracle DB 9.2.4 with
> > the java.lang.threads. In other word we want to execute a
> > procedure/package without waiting the result from the (for example)
> > SQL*Plus propmt.
> >
> > The java class we have created has this piece of code inside:
> >
> > . . .
> > Thread thread = new forkato();

Do you know the convention to start Java class names with upper case letters?

> > thread.setDaemon(true);
> > thread.start();
> > . . .
> >
> > but the class don't terminate, waiting the thread forkato ending: as

You probably mean, "the method containing this code does not terminate".

> > opposed as we want !
> >
> > Anybody has used this method ?
>
> AlexLi,
> I assume that "forkato" is a java class that extends class "Thread".
> I assume "forkato" has a "run()" method. Perhaps you have coded an
> infinite loop in this "run()" method? When the "run()" method
> terminates, the thread terminates -- regardless of whether you make
> it a daemon thread or not. Have you tried using the "forkato" class
> in a different JVM -- outside of the database? Does it terminate
> correctly in a different JVM?

Probably he has overriden start() and not run() thusly executing the code in the current thread instead of a new thread.

    robert Received on Thu May 06 2004 - 05:04:14 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US