pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: pgsql-jdbc@postgresql.org
Subject: java.sql.SQLException: ERROR: canceling query due to user request
Date: Wed, 17 Aug 2005 17:51:50 -0500
Message-ID: <s3037941.000@gwmta.wicourts.gov> (raw)

The server is 8.0.3 running on Windows.  The client is using the 311 build with some patches we need (from the stable branch).  There is nothing we know of which would be canceling things on the server side, and nothing we know of which would be doing so on the JDBC client.  (In fact, when this happens during invocation of the Connection.commit method, I don't think there is a way to cancel it programatically.)
 
A handful of these exceptions may be sprinkled throughout a stream of thousands of queries in the course of a minute.  There is nothing we've been able to identify which differentiates the failing queries form those which succeed.  There is one clue, though -- except for the case where they happen on Connection.commit, they all seem to happen during attempts to update a row through a ResultSet shortly after an exception (such as a duplicate key) was thrown, resulting in the rollback of the previous database transaction.  (That is, Connection.rollback was invoked after catching the exception.)  Connection.autoCommit is set to false.
 
Any suggestions regarding possible causes, possible workarounds, diagnostic steps we should pursue, etc. are welcome.
 
Below are some typical stack traces, from the point where we invoke a JDBC method.  The executeUpdate method was invoked for an UPDATE statement.
 
java.sql.SQLException: ERROR: canceling query due to user request
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
      at org.postgresql.jdbc2.AbstractJdbc2Connection.executeTransactionCommand(AbstractJdbc2Connection.java:625)
      at org.postgresql.jdbc2.AbstractJdbc2Connection.commit(AbstractJdbc2Connection.java:645)
 
java.sql.SQLException: ERROR: canceling query due to user request
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:221)
      at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getPrimaryKeys(AbstractJdbc2DatabaseMetaData.java:3130)
      at org.postgresql.jdbc2.AbstractJdbc2ResultSet.isUpdateable(AbstractJdbc2ResultSet.java:1583)
      at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkUpdateable(AbstractJdbc2ResultSet.java:2444)
      at org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateValue(AbstractJdbc2ResultSet.java:2682)
      at org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateObject(AbstractJdbc2ResultSet.java:1149)
      at org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateObject(AbstractJdbc2ResultSet.java:1511)
 
java.sql.SQLException: ERROR: canceling query due to user request
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:240)
      at org.postgresql.core.Field.getColumnName(Field.java:247)
      at org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateValue(AbstractJdbc2ResultSet.java:2693)
      at org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateObject(AbstractJdbc2ResultSet.java:1149)
      at org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateObject(AbstractJdbc2ResultSet.java:1511)
 
java.sql.SQLException: ERROR: canceling query due to user request
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:282)
 
java.sql.SQLException: ERROR: canceling query due to user request
      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
      at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:282)
      at org.postgresql.jdbc2.AbstractJdbc2ResultSet.updateRow(AbstractJdbc2ResultSet.java:1307)
 




view thread (13+ messages)  latest in thread

Message-ID: <s3037941.000@gwmta.wicourts.gov>
Permalink:  ../s3037941.000@gwmta.wicourts.gov/
Also on:    postgresql.org/message-id/s3037941.000@gwmta.wicourts.gov

 · 

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: Kevin.Grittner@wicourts.gov
  Subject: Re: java.sql.SQLException: ERROR: canceling query due to user request
  In-Reply-To: <s3037941.000@gwmta.wicourts.gov>
  References: <s3037941.000@gwmta.wicourts.gov>

* 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