pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Radosław Smogura <rsmogura@softperience.eu>
To: pgsql-jdbc@postgresql.org
Cc: Andreas Joseph Krogh <andreak@officenet.no>
Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob
Date: Tue, 8 Feb 2011 16:18:28 +0100
Message-ID: <201102081618.28188.rsmogura@softperience.eu> (raw)
In-Reply-To: <23828143.70.1297164859086.JavaMail.on@prod2>
References: <23828143.70.1297164859086.JavaMail.on@prod2>

Andreas Joseph Krogh <andreak@officenet.no> Tuesday 08 February 2011 12:34:19
> I hear over and over that PGs JDBC-driver wants to map CLOBs to OIDs but
> there really doesn't seem to be any good reasons for it (at least not that
> I can see). Why would I want to map my data as OID instead of varchar when
> the data is a JAVA-String? Is anyone using LO and the LO-api for storing
> large character-data? I think not. The @Lob annotation (which started this
> thread) is just there to help other DBs map the String-property correctly,
> I would love to get rid of it but need it to have my app work with Oracle.
> I also want other properties of varchar to work (LIKE-operator f.ex.,
> which Oracle also support on CLOBs), and I don't know what the PG-LO type
> supports. Honestly; I don't see any reason to use LOs at all, neither for
> BLOB (where I use bytea) or CLOBs (where I use varchar).

Actually there is good reason LOB are streamed. As it stands it's "large 
object", and need special treatment. This LO can be 1,2 or 16GB. If you will 
use bytea (it's impossible for such large objects) PGSQL sends all data in one 
message so, select * my_table_with_los will end with OutOfMemory. 2nd reason 
is that different communication is performed with LOBs, this is streaming 
mode, which is faster so you will not OOM your JVM. You need to understand 
that LO wasn't made to be something more then "fiele systems" in database for 
realy big files.

CLOBS are more historical, in days of XMLs, but historical applications still 
exists and sitll many systemes use plain flat files to exchange data.



view thread (36+ messages)  latest in thread

Message-ID: <201102081618.28188.rsmogura@softperience.eu>
Permalink:  ../201102081618.28188.rsmogura@softperience.eu/
Also on:    postgresql.org/message-id/201102081618.28188.rsmogura@softperience.eu

 · 

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 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: rsmogura@softperience.eu, andreak@officenet.no
  Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob
  In-Reply-To: <201102081618.28188.rsmogura@softperience.eu>
  References: <23828143.70.1297164859086.JavaMail.on@prod2> <201102081618.28188.rsmogura@softperience.eu>

* 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