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

Home -> Community -> Usenet -> c.d.o.server -> Re: java stored procedures fast, but slow when called as SQL function

Re: java stored procedures fast, but slow when called as SQL function

From: Noons <wizofoz2k_at_yahoo.com.au.nospam>
Date: 19 Apr 2003 15:29:21 GMT
Message-ID: <Xns9363EF3AA681Tokenthis@210.49.20.254>


Following up on Peter J. Holzer, 19 Apr 2003:

> In languages like Java
> and Perl it becomes harder, because they have pointers.

Come again? Pointers in Java? Only if it is inside the JVM.

>
> Oracle already introduced the oracle.* classes and the JSQL
> preprocessor. There is a good chance that a lot of Java code written for
> Oracle isn't portable. So far (AFAIK) Sun hasn't complained (they might
> have complained, if MS had done the same thing, though :-).

If you look again, these classes do not replace ANY functionality that is in the standard from Sun. They are add-ons. That's perfectly kosher. Why should Sun object to that? But the day Oracle REPLACES any standard JRE functionality with their own, you can bet Sun will yell loud and clear.

>
> I just happen to disagree with you about the reason for the performance
> difference and on the definitions of the words "interpreter" and
> "virtual machine". The definitions of course are a purely semantic issue

Of course! But fact is: there is a performance penalty for context switching between Java and SQL or PL/SQL, whatever direction. And it won't go away without some major surgery on all sides.

> (if I call a table a cat, it will be confusing to people, but I can
> still put my cup of coffee on it), the reasons for the performance
> difference, however, have a practical relevance for programmers. If they
> know how the interface between the JVM and the SQL engine in Oracle
> looks like, they can decide what is fast and what is slow, and what will
> likely stay the same in the next version of Oracle and what might
> change.

Well, I'd say anything that causes a context switch to-from the Java environment will always be slow, regardless of whatever Oracle may do to optimize Java. Either that or Sun grants Oracle a special licence to do fancy stuff with the JVM. I don't think they will, but I'll stand corrected if it ever happens. In the meantime: I won't be coding ANY functions in Java to be called by SQL. ;)

-- 
Cheers
Nuno Souto
wizofoz2k_at_yahoo.com.au.nospam
Received on Sat Apr 19 2003 - 10:29:21 CDT

Original text of this message

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