[Pljava-dev] Fw: out of memery

From: thomas at tada(dot)se (Thomas Hallgren)
To:
Subject: [Pljava-dev] Fw: out of memery
Date: 2006-03-17 08:01:07
Message-ID: 441A6CC3.4030401@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pljava-dev

Hi Lifeng

The postgresql backend will issue a call to the Java language handler.
One call per retrieved row. The first call will issue a call to your
static method, take the ResultSet that is returned, wrap it in a
org.postgresql.pljava.internal.ResultSetPicker and then issue a call to
assignRowValues() on that wrapper. That method in turn will issue a call
to next() on your ResultSet. Data from the ResultSet is then copied over
to a tuple. Now the function returns.

Subsequent calls from pgsql to get the remaining rows will now call the
assignRowValuues() that in turn will call next() on your result set.
This will happen, one row at a time, until your ResultSet returns false
on a call to next() or until the query is interrupted.

For more info, see:
http://www.postgresql.org/docs/8.1/interactive/xfunc-c.html. Especially
the section titled "32.9.10. Returning Sets from C-Language Functions".

Relevant parts of the PL/Java source code can be found in:

src/C/pljava/Backend.c
src/C/pljava/Function.c
src/C/pljava/type/ResultSetProvider.c

src/java/pljava/org/postgresql/pljava/ResultSetHandle.java
src/java/pljava/org/postgresql/pljava/internal/ResultSetPicker.java

Hope this helps,

- thomas

lifeng wrote:
> , ???
>
> Can you tell me how the pgsql use the ResultSetHandler through the function mechanism and which apis are used by pgsql.
> thank you very much.
>
>

In response to

Browse pljava-dev by date

  From Date Subject
Next Message Jon Brisbin 2006-03-17 18:47:35 [Pljava-dev] pljava kills my postgres server
Previous Message Thomas Hallgren 2006-03-17 07:22:39 [Pljava-dev] Failed to create java VM