pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Radosław Smogura <rsmogura@softperience.eu>
To: pgsql-jdbc@postgresql.org
Subject: Re: Implementation of query timeout
Date: Fri, 30 Oct 2009 18:35:25 +0100
Message-ID: <200910301835.25701.rsmogura@softperience.eu> (raw)

Dnia piątek 30 październik 2009 o 08:47:02 napisałeś:
> Radoslaw Smogura wrote:
> > I read a TODO list, and I decided to help a bit. So I've tried to
> > implement queryTimeout, currently ony for non-batch statements. You can
> > see code, at http://rsmogura.net/pgsql/pgsql_jdbc_querytimeout.tar.bz2
> > and analyze, chceck and test it.
> >
> > Small description how it works.
> >
> > 1. When the query is executed it checks if timeout > 0.
> > 2. If yes it creates TimerTask and add it to the queue, then sends the
> > query to server.
> > 3. On timeout and if statement hasn't ended cancelStatement is called().
> 
> Maybe I am missing something there, but wouldn't it be much easier
> to send the following to the server:
> 
> SET statement_timeout=<n>
> 
> Then all statements that time out throw an exception with SQLSTATE 57014,
> and there's no need for separate threads and canceling the query.
> 
> Yours,
> Lauernz Albe
> 
Hello,
SET statement_timeout only set timeout for statement processing on server, it 
not include the time of transfering data, which can be long for BLOBs. I've 
found few posts that this is not enaugh solution "SET statement_timeout" from 
above reasons. It's way those timeout is implemented in JDBC side.

Kind regards,
Radek Smogura.



view thread (4+ messages)  latest in thread

Message-ID: <200910301835.25701.rsmogura@softperience.eu>
Permalink:  ../200910301835.25701.rsmogura@softperience.eu/
Also on:    postgresql.org/message-id/200910301835.25701.rsmogura@softperience.eu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: rsmogura@softperience.eu
  Subject: Re: Implementation of query timeout
  In-Reply-To: <200910301835.25701.rsmogura@softperience.eu>
  References: <200910301835.25701.rsmogura@softperience.eu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox