agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] Fw: out of memery
Date: Fri, 17 Mar 2006 09:01:07 +0100
Message-ID: <441A6CC3.4030401@tada.se> (raw)
In-Reply-To: <20060317044756.BF2C6196150@smtp.263.net>
References: <20060317044756.BF2C6196150@smtp.263.net>

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.
>
>   





view thread (7+ messages)  latest in thread

Message-ID: <441A6CC3.4030401@tada.se>
Permalink:  ../441A6CC3.4030401@tada.se/
Also on:    postgresql.org/message-id/441A6CC3.4030401@tada.se

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] Fw: out of memery
  In-Reply-To: <441A6CC3.4030401@tada.se>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox