Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 5B3E46338A3 for ; Tue, 7 Apr 2009 07:24:29 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 87516-05 for ; Tue, 7 Apr 2009 07:24:19 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by mail.postgresql.org (Postfix) with ESMTP id DC3526330A6 for ; Tue, 7 Apr 2009 07:24:24 -0300 (ADT) Received: by qw-out-2122.google.com with SMTP id 8so1793584qwh.61 for ; Tue, 07 Apr 2009 03:24:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=6WqvaVxmEhXnnMouiS9vQSDwQCHsw29YGx5pZpsWxrY=; b=Eg5MN4j/XPyAUDqIrboR660mhyXOoThqXNKqkzoFb2eH1KP34Qudh82Ch6oSoJ7DVk RxaxyUCAmPBabm1pMirnpKYQj6fdtbu7ILahcXMUEXFP71mNsdf6JIItm+Gkv1Muyzld KYR3fb11gZlxAF7oKK9ECegCyr3GUPg55ZoSc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=ZVBiIkSmhrctQJ71ACF/f+8lVAVIpt6TtXt8kUqtemmKTrNb1eSqQp2qRhuq+l08A+ 3Fx9uRWHKy9yN/K0nepCQ0HgNM6jkny8qXIgd8L0xvegIdxfTEMrRiuSZSomAXvqfZYb cBLmal/hWoLyCZFBN+NVWHslsh32wwx0HDdRA= MIME-Version: 1.0 Received: by 10.229.80.3 with SMTP id r3mr1345616qck.104.1239099863533; Tue, 07 Apr 2009 03:24:23 -0700 (PDT) In-Reply-To: <1239093322.7647.9.camel@huvostro> References: <1236241901.12460.6.camel@huvostro> <491f66a50903050513r46ab0531h4892e973dec51f18@mail.gmail.com> <1239016398.8411.2.camel@huvostro> <491f66a50904060443o7e80fae8mfb6f403fb9a53467@mail.gmail.com> <1239093322.7647.9.camel@huvostro> Date: Tue, 7 Apr 2009 06:24:23 -0400 X-Google-Sender-Auth: 2f08b17be50ecfcd Message-ID: <491f66a50904070324g19aee516vb5b1922b23450a27@mail.gmail.com> Subject: Re: What do people use for connection pooling with PostgreSQL JDBC From: Dave Cramer To: Hannu Krosing Cc: pgsql-jdbc@postgresql.org Content-Type: multipart/alternative; boundary=0016364269bd35086f0466f46bc4 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200904/6 X-Sequence-Number: 19453 --0016364269bd35086f0466f46bc4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 > > > -- > Hannu Krosing http://www.2ndQuadrant.com > PostgreSQL Scalability and Availability > Services, Consulting and Training > > --0016364269bd35086f0466f46bc4 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, Apr 7, 2009 at 4:35 AM, Hannu Kr= osing <hannu@= 2ndquadrant.com> 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(
=A0 =A0 =A0 =A0multiplier bigint,
=A0 =A0 =A0 =A0valuelist bigint[],
=A0 =A0 =A0 =A0OUT result int
) AS
$$
BEGIN
=A0 =A0result =3D 0;
=A0 =A0FOR idx IN array_lower(valuelist, 1)..array_upper(valuelist, 1) LOO= P
=A0 =A0 =A0 =A0result =3D result + multiplier * valuelist[idx];
=A0 =A0END LOOP;
=A0 =A0RETURN;
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 -

=A0 Long[] array =3D { 1L, 2L };
=A0 PreparedStatement ps =3D conn.prepareStatement(
=A0 =A0 =A0 =A0"SELECT * FROM arraySum(?, ?)");
=A0 ps.setLong(1, 3L);
=A0 ps.setArray(2, conn.createArrayOf("bigint", array));
=A0 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) com= plain to dbcp people
=A0


--
Hannu Krosing =A0 http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
=A0 Services, Consulting and Training


--0016364269bd35086f0466f46bc4--