Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle and Java - a useful partnership?

Re: Oracle and Java - a useful partnership?

From: Thomas Kyte <>
Date: Tue, 14 Dec 1999 08:16:48 -0500
Message-ID: <>

A copy of this was sent to (if that email address didn't require changing) On Tue, 14 Dec 1999 09:49:21 GMT, you wrote:

>According to the Oracle documentation, "...any public static Javamethod
>can run in the RDBMS as a stored procedure..."
>Please correct me if I'm wrong, but doesn't this raise a whole host of
>concurrency/performance issues. If the method is static, Oracle's JVM
>will use the 'same' method for all calls made upon a given stored
>In a multi-client system there would be the possibility of muddled
>results or of bottlenecks caused by synchronization ---- OR am I
>missing the point?
>Why doesn't the Oracle JVM execute each stored procedure as a separate
>object instance/thread??? Someone suggested that a different JVM might
>handle each call on the Stroed Procedure in a separate JVM. Wouldn't
>the overheads be very high for such an approach??

No, see -> Test Results to see that each session gets its own 'virtual' jvm -- not a full up jvm instance (but as far as it is concerned, it has its own jvm).

>Also, wouldn't a Java Stored Procedure execute quite slowly i.e.
>youhave two lots of JDBC overheads, one from the stored procedure to
>theoracle database and the JDBC overhead from using the callable
>statementthat calls the stored procedure?

no more then calling a stored procedure written in language "X".

>Might it be more effective to RMI or Socket between the stored
>procedure and the the client or middle tier? But, how could this be
>done? Call the procedure once to 'activate it' and then it could run
>waiting for requests.

double the resources -- you need to call the database (socket) to get the procedure running (and you have to keep that connection). then, in another thread on the client, you would have to setup a client socket for the java sp to connect back to (another socket between this client and the server). It would not scale very well -- the database is designed to do this with connection pooling and such.

>Many thanks in advance.
>Sent via
>Before you buy.

See for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte         
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Dec 14 1999 - 07:16:48 CST

Original text of this message