Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 1EEE81337BBE for ; Fri, 15 Oct 2010 11:39:03 -0300 (ADT) 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 81775-05 for ; Fri, 15 Oct 2010 14:38:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 4224C1337BB0 for ; Fri, 15 Oct 2010 11:38:55 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o9FEcspH020261; Fri, 15 Oct 2010 10:38:54 -0400 (EDT) To: Stephen Frost cc: =?utf8?B?UmFkb3PFgmF3?= Smogura , Magnus Hagander , David Fetter , Kevin Grittner , PG Hackers , PostgreSQL JDBC List , robertmhaas@gmail.com Subject: Re: [JDBC] Support for JDBC setQueryTimeout, et al. In-reply-to: <20101015142126.GQ26232@tamriel.snowman.net> References: <20101011064615.GJ29408@fetter.org> <4CB2CADC020000250003676B@gw.wicourts.gov> <88dcb3988805ede17af4a460ad251534@smogura-softworks.eu> <20101012141439.GA29627@fetter.org> <4CB43A4C0200002500036826@gw.wicourts.gov> <20101012155531.GB29627@fetter.org> <528f31015d6bf68650646b9b4ba71a10@smogura-softworks.eu> <20101015142126.GQ26232@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Fri, 15 Oct 2010 10:21:26 -0400" Date: Fri, 15 Oct 2010 10:38:54 -0400 Message-ID: <20260.1287153534@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/1026 X-Sequence-Number: 172066 Stephen Frost writes: > * Radosław Smogura (rsmogura@softperience.eu) wrote: >> But benefits of pooling statements are much more greater then RESET ALL, >> because you can take advance of precompiling prepared statements, >> increasing performance; it is comparable to using connection pool instead >> of starting physical connections. > errr, I don't believe RESET ALL touches cache'd plans and whatnot (which > is actually a problem I've run into in the past, because changing the > search_path also doesn't invalidate plans, and neither does set role, so > you end up with cache'd plans that try to hit things you don't have > permissions to any more :( ). Yeah, actually what you need is DISCARD ALL when reassigning a connection to another client. Anything less than that assumes the clients are cooperating closely, ie they *want* the same prepared statements etc. But even if you make that assumption, a pooler that isn't even capable of sending an ABORT between clients doesn't seem usable to me. For example, if a client loses its network connection mid-transaction, that failure will cascade to other clients if you don't have any ability to reset the database session before handing it to another client. regards, tom lane