From: Kris Jurka <books@ejurka.com>
To: Radosław Smogura <rsmogura@softperience.eu>
Cc: Александър Шопов <lists@kambanaria.org>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Workarounds for getBinaryStream returning ByteArrayInputStream on bytea
Date: Fri, 26 Nov 2010 10:25:01 -0500 (EST)
Message-ID: <alpine.BSO.2.00.1011261019010.21699@leary.csoft.net> (raw)
In-Reply-To: <d6544fb5a3293dfb4ac6586893ab3417@smogura-softworks.eu>
References: <1290631846.3659.9.camel@dalgonosko>
<5cdf97054e76f67c40b74de114691762@smogura-softworks.eu>
<1290639211.3659.15.camel@dalgonosko>
<d6544fb5a3293dfb4ac6586893ab3417@smogura-softworks.eu>
On Fri, 26 Nov 2010, Rados?aw Smogura wrote:
> I would like to send few files for getBinaryStream(). So this will work
> much like stream and will don't eat so much heap. I don't copy source
> this_row[i] array, so I don't know how this will do with concur updates,
> (original method doesn't make this when column is not bytea, too). I left
> few comments if we should throw exception on broken streams in 8.4, or just
> silence notify EOF.
The problem is that the whole bytea is still in this_row[i]. The value
isn't being streamed from the server. So yes, you are saving a copy of
the value which does save heap space, but that won't really help the
described problem where many large bytea values are fetched because the
driver will have read and stored them all prior to getBinaryStream being
called.
Kris Jurka
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, rsmogura@softperience.eu, lists@kambanaria.org
Subject: Re: Workarounds for getBinaryStream returning ByteArrayInputStream on bytea
In-Reply-To: <alpine.BSO.2.00.1011261019010.21699@leary.csoft.net>
References: <1290631846.3659.9.camel@dalgonosko> <5cdf97054e76f67c40b74de114691762@smogura-softworks.eu> <1290639211.3659.15.camel@dalgonosko> <d6544fb5a3293dfb4ac6586893ab3417@smogura-softworks.eu> <alpine.BSO.2.00.1011261019010.21699@leary.csoft.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox