Re: ResultSet memory usage

From: Barry Lind <barry(at)xythos(dot)com>
To: Timo Savola <timo(dot)savola(at)codeonline(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSet memory usage
Date: 2002-01-11 17:51:48
Message-ID: 3C3F2634.5030708@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

> Couldn't that still be implemented in the JDBC driver by reading from
> the socket a little at a time? Or would that introduce bigger problems,
> like catastrophic slowdown of other connections to the backend?

It can't. Consider the following example:

ResultSet l_rset1 = l_stmt1.executeQuery("select a from foo");
while (l_rset1.next()) {
ResultSet l_rset2 = l_stmt2.executeQuery("select b from bar where a =
" + l_rset1.getInt(1));
while (l_rset2.next()) {
//do something useful
}
}

This example shows that you need to be able to use the socket to execute
other queries while you are still fetching from the first. Doing what
you suggest would break many applications that use jdbc.

thanks,
--Barry

Timo Savola wrote:

>>Unfortunately this is an artifact of the way the backend works, once the
>>request is made the backend is going to give us all the data.
>>
>
> Couldn't that still be implemented in the JDBC driver by reading from
> the socket a little at a time? Or would that introduce bigger problems,
> like catastrophic slowdown of other connections to the backend?
>
> Timo
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2002-01-11 17:58:04 Re: LISTEN/NOTIFY support in JDBC driver?
Previous Message Barry Lind 2002-01-11 17:45:34 Re: Proposal for a configurable ResultSet implementation