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: Making a little java server under oracle

Re: Making a little java server under oracle

From: dmz17 <dmz17_at_nospam.nowhere.com>
Date: Sat, 30 Nov 2002 10:53:57 +0100
Message-ID: <pan.2002.11.30.09.53.57.355723@nospam.nowhere.com>


On Fri, 29 Nov 2002 14:27:03 +0000, Simon Harvey wrote:

> Sorry, Its me again!
>
> I have been having another think about how java works under oracle and there
> is something else that is really confusing me - why all the examples I've
> seen are declared static.
>
> Why is that? I'm really worried that I'm in trouble with my project now -
>
> What I need is for the little server application to run in the background
> and be notified when something happens. I was thinking I could perhaps have
> a pl/sql trigger contact the server when an event has occured.
>
> But how would the server be notified? Would the plsql call a method of the
> class? Oh I'm just very confused! :(
>
> All I want is for the server to find out about stuff and then pass that
> "stuff" onto someone else. But if everything is static and I cant have
> threads, then how how can this all work.
>
> Id really really appreciate any information anyone has. Has anyone tried
> this before.
>
> Thnaks
>
> Simon

First of all: Java Stored Procedures MUST be declared static. Nothing else really makes sense, if you think about how they are being used. You have only one procedure that would service all clients.

Second: don't run servers in the Oracle Java VM inside the databases. Oracle's current advice is to not do it because the capability may disappear in future versions. It took two release cycles for Oracle to establish the huge performance impact Java EJB and other J2EE components have when run inside the database.

Using Stored Procedures is OK, though. As long as you make sure you don't have too many context switches (Java-PL/SQL/Java) in the process. Those switches are performance hogs.

Don't mess with theads inside the database.

My advice is: don't do Java in the database unless you write a procedure that would kill the machine if written in PL-SQL. This would be massive math stuff or even XML parsing. And even in this case you might be better off just gettting the data from the database and parse the XML stuff outside.

Cheers,

dmz17 Received on Sat Nov 30 2002 - 03:53:57 CST

Original text of this message

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