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: Peter J. Holzer <hjp-usenet_at_hjp.at>
Date: Fri, 18 Apr 2003 11:40:39 +0200
Message-ID: <slrnb9vi0m.1mg.hjp-usenet@teal.hjp.at>


On 2003-04-16 00:12, Nuno Souto <wizofoz2k_at_yahoo.com.au> wrote:
> Now, is a JVM "just an interpreter"? I don't think so. Let's look at
> the traditional other interpreter in the market: VBA. A VBA program
> runs as an OS process

Same for a java program

> and has the same access to the OS that any other program may have.

Same for a java program (but not an applet).

> A DLL is engaged to interpret the byte-code, but it is just running as
> a normal process in the OS. In fact, the interpreter runs in the same
> process space as the program.

Same for the JVM.

> You want to call a Windoze internal DLL directly from VBA? Hey, knock
> yourself out: it's perfectly possible and you do it directly from the
> program.

Microsoft chose to include this capability in VBA, Sun chose not to do it, but published the JNI specs instead. In the end, you can do the same with both. However, even if you couldn't call DLLs in Java at all, that would not make it "not an interpreter". You can't call DLLs in PostScript, for example, but nobody (I hope) would claim that PostScript isn't an interpreter.

> A JVM program MUST have the JVM started BEFORE it can execute.

Same for VBA. Code not yet loaded cannot be executed :-)

> You can't
> start ANOTHER program in that same JVM address space unless the first
> program does that for you.

Not sure what that is supposed to mean nor whether that's any different from VBA.

> The program cannot access the OS file system
> directly.

No more or less than in VBA.

> The program cannot access the OS network layers directly. Try

No more or less than in VBA.

> and access the Windoze GUI directly from Java.
> I know, there are class libraries that let you do that. I said "directly".
> Cannot, eh? Bingo.

So what? You can't do that from PostScript either. Or from PL/SQL, to get back to the Java-PL/SQL comparison we started with.

> There is the difference. In order to provide the "sandbox" concept,
> the JVM has to isolate the program from whatever OS it's running
> in. "Just an interpreter" does NOT have to do that. Clear?

Every interpreter does that. An interpreter takes an instruction stream in a particular instruction set and executes it according to the rules for that instruction set. That is "completely isolated" from the OS. The interpreted program can never do anything except through the interpreter. The interpreter can implement instructions such as "open file", "execute program" or "call function X in DLL Y", but these have to implemented explicitely - that's not something "just an interpreter" comes naturally with. The authors of the Java class library chose to implement these functions with an added layer of permission checking (the "sandbox"). That makes Java a bit more complicated, but it doesn't change the fact that it is an interpreter nor makes it it any more "virtual machine-like".

        hp

-- 
   _  | Peter J. Holzer    | Latein ist das humanoide Äquivalent
|_|_) | Sysadmin WSR       | zu Fortran.
| |   | hjp_at_hjp.at         |
__/   | http://www.hjp.at/ |    -- Alexander Bartolich in at.linux
Received on Fri Apr 18 2003 - 04:40:39 CDT

Original text of this message

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