Re: [GENERAL] java stored procedures

From: Laszlo Hornyak <hornyakl(at)freemail(dot)hu>
To: Barry Lind <barry(at)xythos(dot)com>, pgsql-hackers(at)postgresql(dot)org, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [GENERAL] java stored procedures
Date: 2001-12-05 19:39:28
Message-ID: 3C0E77F0.5030904@freemail.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-jdbc

Barry Lind wrote:

>
> I also stopped cc'ing the general list, since this is getting too
> detailed for most of the members on that list.

Ok.

> Now to your mail:
>
> This seems like a reasonable approach and should work across different
> JVMs. It would probably be a good experiment to try this with the Sun
> or IBM jvm at some point to verify. What I was afraid of was that you
> were hacking the Kaffe code to perform the integration which would
> limit this solution to only using Kaffe.

I am sure they wont work the same way. I think I have a sun jdk 1.3.0-2,
so I will try to port it soon. The IBM implementation must wait I think
until january.

>
> Just a suggestion: PL/J might be a good name, since as you probably
> know it can't be called pl/java because of the trademark restrictions
> on the word 'java'.

Ok, you won, I do not read the licenses. From now it`s name is pl/j.
Isn`t 'j' too short for the name of the process that runns java? :)

>
> I am a little concerned about the stability and complexity of having
> this '-pizza' program be responsible for handling the calls on the
> java side. My concern is that this will need to be a multithreaded
> program since multiple backends will concurrently be needing to
> interact with multiple java threads through this one program. It
> might be simpler if each postgres process directly communicated to a
> java thread via a tcpip socket. Then the "-pizza" program would only
> need to be responsible for starting up the jvm and creating java
> threads and sockets for a postgres process (it would perform a similar
> role to postmaster for postgres client connections).

With good design we can solve stability problems. As much as I know, if
postmaster dies, the postgres server becomes unavailable, this looks the
same problem. I do not know if we realy need sockets. Anyway, if 'j'
dies, we can create a new one, and restart calculations. Some watchdog
functionality...
Doing thing with sockets need a lot of rework. It is the best time for
this, while there is not too much thing done.

>>>
>>>> -when java thread receives the signal, it reads the message(s) from
>>>> the queue, and starts some actions. When done it tells postgres
>>>> with a signal that it is ready, and it can come for its results.
>>>> This will be rewritten see below problems.
>>>
>>> Are signals the best way to accomplish this?
>>
>> I don`t know if it is the best, it is the only way I know :)
>> Do you know any other ways?
>>
> I don't know, but hopefully someone on the hackers list will chip in
> here with a comment.

After a first developement cycle (if my brain doesn`t burn down), the
signals can be replaced to a plugable communication interface I think.
So maybe we can use CORBA, or sockets, or something else. This will take
a lot of time.

> OK, so the same backend process that called the function gets messaged
> to process the sql. This should work. However it means you will need
> a special version of the jdbc driver that uses this shm+signals
> communication mechanism instead of what the current jdbc driver does.
> This is something I would be happy to help you with.

This is kind of you. :)
For this, I will have to finish the protocol of communication. I have to
learn Postgres enough, so I am not sure this will be done this weekend.
I have ideas, only time is needed to implement them or to recognize the
failures.

Thanks,
Laszlo Hornyak

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Yanek Korff 2001-12-05 20:23:42 duplicate templates, wrong users
Previous Message Robert J. Sanford, Jr. 2001-12-05 18:52:04 grant on multiple tables?

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-12-05 20:50:28 Re: Security note: MS SQL is current worm vector
Previous Message Doug McNaught 2001-12-05 19:23:57 Re: Licensing

Browse pgsql-jdbc by date

  From Date Subject
Next Message Lester June Cabrera 2001-12-06 04:40:34 7.3 build of PostgreSQL JDBC Driver
Previous Message Dave Cramer 2001-12-05 18:26:58 Problems with numeric (10,2) and big Decimal