From: Oliver Jowett <oliver@opencloud.com>
To: Andreas Joseph Krogh <andreak@officenet.no>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Date: Wed, 09 Feb 2011 22:40:00 +1300
Message-ID: <4D5260F0.9000908@opencloud.com> (raw)
In-Reply-To: <4D524A75.2090305@officenet.no>
References: <201102070001.22259.andreak@officenet.no>
<201102070911.20245.rsmogura@softperience.eu>
<4D505B02.804@officenet.no>
<alpine.BSO.2.00.1102081917080.25347@leary.csoft.net>
<4D524A75.2090305@officenet.no>
Andreas Joseph Krogh wrote:
> On 02/09/2011 01:20 AM, Kris Jurka wrote:
>> The problem is that we have no idea what someone might want to do with a
>> CLOB after they've fetched it. You're coming from the idea that all
>> they want to do is read it and copy the data out to a String. From that
>> perspective it's not hard to have a Clob wrapper around a String, but
>> what happens when they say clob.setString(13, "data")? Are we going to
>> try and figure out what row of what table that varchar column is coming
>> from and do a partial update on it?
> So, I think clob.setString(index, data) should behave just like
> StringBuilder.insert(int offset, String str) except overwrite existing
> data instead of moving the characters above the position.
You really missed Kris' point here - the question is not "how should we
modify the data?" but "how do we locate the data to modify in the first
place?". Consider:
SELECT somedatacolumn FROM sometable WHERE complex condition
Now you have a resultset with one column. It's a varchar. The caller
calls ResultSet.getClob().setString(). What does the driver do?
Synthesize an UPDATE statement? How? With what parameters?
Oliver
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: oliver@opencloud.com, andreak@officenet.no
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob
In-Reply-To: <4D5260F0.9000908@opencloud.com>
References: <201102070001.22259.andreak@officenet.no> <201102070911.20245.rsmogura@softperience.eu> <4D505B02.804@officenet.no> <alpine.BSO.2.00.1102081917080.25347@leary.csoft.net> <4D524A75.2090305@officenet.no> <4D5260F0.9000908@opencloud.com>
* 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