Re: Java Stored Proc Slow....

From: Cliff Dabrowski <cliffdw_at_my-deja.com>
Date: Thu, 3 Jan 2002 17:03:32 -0500
Message-ID: <3c34d5f6$1_at_172.22.1.229>


Peter,

There are several issues that could be affecting the relative performance of your experiment.

  1. You may be experiencing some time for the JVM to spin up or your objects may need to be loaded causing some execution delay.
  2. The Java version implemented in the Oracle DB may not necessarily be as fast as that loaded to your desktop and your expectations (although justified) may not match the capabilities of the Oracle JVM.
  3. Question, Have you dealt with any/all issues of permissions to allow for the invocation/execution of your shell command via the Java class. I assume you have since you were able to complete timings with the stub shell script.

If you want to provide samples of your code I would gladly run the same on my system as a comparative test for you. Please include the code and indicate exact Oracle DB version.

Best Regards,

~Cliff

P.S. If you are interested I can provide you information on how to trial our Oracle development tools that allow you to Debug your Java Stored Procedures. We have seamless cross-language debugging from PL/SQL to JSP and back complete with all features expected from any development workbench.

"Peter" <pchristopher_at_munis.com> wrote in message news:a0c6518a.0201031230.654fb055_at_posting.google.com...
> My situation is pretty straightforward. I need a stored procedure to
> call a UNIX command (actually, an Infomix program, but that's besides
> the point).
>
> What I am doing is using Java Stored Procedures to call a small piece
> of Java that I loaded into an Oracle 8i database. The java simply
> invokes the Java Runtime.exec() to shell the command out the the OS. I
> chose this because the DBMS_Pipes is not practical to deploy to our
> customer base.
>
> The JSP method seems very straightforward, but it is running VERY
> slow. Here are some example times:
>
> ODBC --> JSP --> JAVA (just return back, no runtime call) = .67 secs
> ODBC --> JSP --> JAVA --> UNIX (no code executed, just return back) =
> 1.15 secs
> (NOTE: calling the JSP from SQL*Plus is insignificantly faster, so
> ODBC is not my issue!)
>
> Seems way to long considering the Java is just passing along a system
> call and the Unix command run was an empty shell script. In fact, the
> UNIX program that I intend to run does a whole lot of work, SQL
> inserts/updates/deletes and that whole process only takes 0.8 secs. So
> the JSP call more than doubles the execution time. That is
> unacceptable to me.
>
> Any suggestions on where the bottleneck may be??
Received on Thu Jan 03 2002 - 23:03:32 CET

Original text of this message