From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | Dave Cramer <pg(at)fastcrypt(dot)com> |
Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, David Fetter <david(at)fetter(dot)org> |
Subject: | Re: pl/Ruby, deprecating plPython and Core |
Date: | 2005-08-17 14:00:57 |
Message-ID: | 43034319.1040507@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Dave Cramer wrote:
> As there are two java procedural languages which are available for
> postgreSQL Josh asked for an explanation as to their differences.
> They are quite similar in that both of them run the function in a
> java vm, and are pre-compiled. Neither attempt to compile the code.
>
> The biggest difference is how they connect to the java VM.
>
> PL/Java uses Java Native Interfaces (JNI) and does a direct call into
> the java VM from the language handler.
>
> PL-J uses a network protocol to connect to a java VM.
>
>
> There are advantages and disadvantages to both approaches.
>
> + JNI is simpler, doesn't require a protocol, or an application
> container to manage the User Defined Functions
> - JNI requires that the vm runs on the server machine, and a separate
> vm be instantiated for every connection that calls a function.
> This is mitigated somewhat in java 1.5, by sharing data, however
> this may or may not be a Sun only feature ( does anyone know );
> either way a separate vm is required for each connection.
> - startup time for the vm on the first call for the connection.
> - Possible ( not as likely any more ) for the java VM to take the
> server down.
>
> Using a network protocol such as a pl-j does has the following (
> basically the opposite of the JNI (dis)advantages )
>
> + The java VM does not have to run on the server.
> + Only one vm per server
> - More complex, requires a micro kernel application server to manage
> the UDF's currently http://loom.codehaus.org/
>
>
That's a pretty good explanation and ought to be published more widely.
It's almost a pity that we couldn't have one project with a server
setting saying how we want it to run.
I seem to recall hearing of a Sun gadget in the works that would let a
process connect to a running VM and load classes and run them. I have
been a bit out of it on Java lately - does anyone know of such a thing,
or is my memory failing again?
cheers
andrew
From | Date | Subject | |
---|---|---|---|
Next Message | jtv | 2005-08-17 14:03:15 | Re: transactions not working properly ? |
Previous Message | Michael Fuhr | 2005-08-17 13:59:16 | Re: transactions not working properly ? |