Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D3833633662 for ; Tue, 7 Apr 2009 10:24:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 59969-10 for ; Tue, 7 Apr 2009 10:24:16 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.televork.ee (mail.televork.ee [81.21.241.190]) by mail.postgresql.org (Postfix) with ESMTP id 10596632E69 for ; Tue, 7 Apr 2009 10:24:15 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.televork.ee (Postfix) with ESMTP id BEECC185FA8; Tue, 7 Apr 2009 16:23:51 +0300 (EEST) X-Virus-Scanned: at mail.televork.ee Received: from mail.televork.ee ([81.21.241.190]) by localhost (mail.televork.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fMOTDgO1d4ot; Tue, 7 Apr 2009 16:23:44 +0300 (EEST) Received: from [127.0.0.1] (81-21-242-98.televork.ee [81.21.242.98]) by mail.televork.ee (Postfix) with ESMTP id 110AC185B5A; Tue, 7 Apr 2009 16:23:33 +0300 (EEST) Subject: Re: What do people use for connection pooling with PostgreSQL JDBC From: Hannu Krosing To: Dave Cramer Cc: pgsql-jdbc@postgresql.org In-Reply-To: <491f66a50904070324g19aee516vb5b1922b23450a27@mail.gmail.com> References: <1236241901.12460.6.camel@huvostro> <491f66a50903050513r46ab0531h4892e973dec51f18@mail.gmail.com> <1239016398.8411.2.camel@huvostro> <491f66a50904060443o7e80fae8mfb6f403fb9a53467@mail.gmail.com> <1239093322.7647.9.camel@huvostro> <491f66a50904070324g19aee516vb5b1922b23450a27@mail.gmail.com> Content-Type: text/plain Date: Tue, 07 Apr 2009 16:23:32 +0300 Message-Id: <1239110612.7647.15.camel@huvostro> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/8 X-Sequence-Number: 19455 On Tue, 2009-04-07 at 06:24 -0400, Dave Cramer wrote: > > > On Tue, Apr 7, 2009 at 4:35 AM, Hannu Krosing > wrote: > On Mon, 2009-04-06 at 07:43 -0400, Dave Cramer wrote: > > huh ? What makes you think it doesn't deal with arrays ? > > > I have a sample function, whit takes an array argument > > CREATE OR REPLACE FUNCTION arraySum( > multiplier bigint, > valuelist bigint[], > OUT result int > ) AS > $$ > BEGIN > result = 0; > FOR idx IN array_lower(valuelist, > 1)..array_upper(valuelist, 1) LOOP > result = result + multiplier * valuelist[idx]; > END LOOP; > RETURN; > END; > $$ LANGUAGE plpgsql SECURITY DEFINER; > > > When I call this function directly via JDBC or using proxool I > get a > result, when doing it via c3p0 or dbcp I get an exception - > > Long[] array = { 1L, 2L }; > PreparedStatement ps = conn.prepareStatement( > "SELECT * FROM arraySum(?, ?)"); > ps.setLong(1, 3L); > ps.setArray(2, conn.createArrayOf("bigint", array)); > ps.execute(); > > OK, createArrayOf is a relatively new method. So .... you have a few > ways around this. > > 1) don't use it, create your own arrays. > 2) fix the dbcp code > 3) complain to dbcp people It's both dbcp and c3po. I understand that dbcp and c3po work on some other databases jdbc drivers, so maybe I could also do 4) fix jdbc code to provide required createArrayOf support no ? > -- Hannu Krosing http://www.2ndQuadrant.com PostgreSQL Scalability and Availability Services, Consulting and Training