Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 522CF1337C9D for ; Tue, 8 Feb 2011 11:50:22 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 30986-02-3 for ; Tue, 8 Feb 2011 15:50:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.softperience.eu (static-ip-217-118-26-141.inaddr.intergenia.de [217.118.26.141]) by mail.postgresql.org (Postfix) with ESMTP id 6A4F61337CD1 for ; Tue, 8 Feb 2011 11:18:24 -0400 (AST) Received: from radek.localnet (87-204-194-135.dg-net.pl [87.204.194.135]) by mail.softperience.eu (Postfix) with ESMTPA id E119FC000CD; Tue, 8 Feb 2011 16:18:29 +0100 (CET) From: =?utf-8?q?Rados=C5=82aw_Smogura?= To: pgsql-jdbc@postgresql.org Subject: Re: ResultSet.getClob() causing problems when used with JPA's @Lob Date: Tue, 8 Feb 2011 16:18:28 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.36-gentoo-r5; KDE/4.4.5; x86_64; ; ) Cc: Andreas Joseph Krogh References: <23828143.70.1297164859086.JavaMail.on@prod2> In-Reply-To: <23828143.70.1297164859086.JavaMail.on@prod2> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201102081618.28188.rsmogura@softperience.eu> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201102/47 X-Sequence-Number: 21445 Andreas Joseph Krogh 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.