Re: [JDBC] Support for JDBC setQueryTimeout, et al.

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Radosław Smogura <rsmogura(at)softperience(dot)eu>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, David Fetter <david(at)fetter(dot)org>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>, PostgreSQL JDBC List <pgsql-jdbc(at)postgresql(dot)org>, robertmhaas(at)gmail(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: [JDBC] Support for JDBC setQueryTimeout, et al.
Date: 2010-10-15 14:21:26
Message-ID: 20101015142126.GQ26232@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

* Radosław Smogura (rsmogura(at)softperience(dot)eu) wrote:
> > To me, that sounds like a bug in the connection pooler. It is only
> > safe under quite limited circumstances.
>
> It's hard to say this is bug. The GF connection pooler is "general pooler"
> for all drivers, so it can't know anything about reseting, and if I have
> right JDBC4 doesn't support such notifications. It can't close logical
> connections, as if would close, cached statements will be invalideted too.

If it can't figure out a way to issue a command in between handing
around a connection to different clients then, yeah, I'd call it a bug
that needs to be fixed. Maybe other systems don't need it, and it can
be a no-op there, but the capability certainly needs to be there.

> 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 :( ).

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-10-15 14:23:27 Re: [JDBC] Support for JDBC setQueryTimeout, et al.
Previous Message Tomáš Pospíšil 2010-10-15 14:08:45 Re: [HACKERS] XML schema validation

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2010-10-15 14:23:27 Re: [JDBC] Support for JDBC setQueryTimeout, et al.
Previous Message Radosław Smogura 2010-10-15 09:11:44 Re: [JDBC] Support for JDBC setQueryTimeout, et al.