X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 20DA0D1B374 for ; Thu, 1 Jul 2004 08:19:09 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 58217-10 for ; Thu, 1 Jul 2004 11:19:08 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 4C75CD1B260 for ; Thu, 1 Jul 2004 08:19:01 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1Bfzal-0002ny-00; Thu, 01 Jul 2004 23:18:59 +1200 Message-ID: <40E3F39A.8010405@opencloud.com> Date: Thu, 01 Jul 2004 23:20:58 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Guido Fiala Cc: pgsql-jdbc@postgresql.org Subject: Re: Query was cancelled - reason? References: <200407011053.00170.guido.fiala@dka-gmbh.de> In-Reply-To: <200407011053.00170.guido.fiala@dka-gmbh.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200407/4 X-Sequence-Number: 10388 Guido Fiala wrote: > Hello, > > i'am currently run into a strange problem with fast subsequent updates in the same table. > > The application is quite complex, so its difficult to to sent a code snippet, i included the network traffic instead: > > This is whats happening: [... COMMIT gets cancelled ...] > So why comes the commit-error? Three possibilities I can think of: - Something is sending SIGINT to the backend process. - You are calling JDBC's Statement.cancel() method (see below) which ends up sending a SIGINT (indirectly via a backend process). - You have statement_timeout set too low; queries appear to be cancelled if they time out. There is (AFAIK) still a race condition in the JDBC driver's implementation of Statement.cancel() which means that it can occasionally cancel a query "in the future" if called just before a query begins execution, i.e. sometimes this sort of code will result in a cancelled query: stmt.cancel(); stmt.executeUpdate("..."); // Could be a different statement // on the same connection too In your case it sounds like it might be: stmt.executeUpdate("..."); stmt.cancel(); // Perhaps done by a connection management layer conn.commit(); // Actually executes a query behind the scenes I looked at fixing cancel() some time ago but my changes didn't make it into the driver in the end. -O