pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
patch: complain obviously about unknown transaction states
2+ messages / 2 participants
[nested] [flat]

* patch: complain obviously about unknown transaction states
@ 2004-07-05 03:16 Oliver Jowett <oliver@opencloud.com>
  2004-07-09 23:58 ` Re: patch: complain obviously about unknown transaction states Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Oliver Jowett @ 2004-07-05 03:16 UTC (permalink / raw)
  To: pgsql-jdbc

ReadyForQuery may change in 7.5, per discussion on -hackers:

   http://archives.postgresql.org/pgsql-hackers/2004-07/msg00184.php

The attached patch makes the driver generate errors on unknown 
transaction states in a ReadyForQuery message, rather than silently 
ignoring them (and probably getting confused).

-O

Attachments:

pgjdbc-check-transaction-state.txt (text/plain, 1.4K) download Index: org/postgresql/core/v3/QueryExecutorImpl.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/core/v3/QueryExecutorImpl.java,v retrieving revision 1.1 diff -u -c -r1.1 QueryExecutorImpl.java *** org/postgresql/core/v3/QueryExecutorImpl.java 29 Jun 2004 06:43:25 -0000 1.1 --- org/postgresql/core/v3/QueryExecutorImpl.java 5 Jul 2004 02:38:21 -0000 *************** *** 1175,1181 **** private void receiveRFQ() throws IOException { if (pgStream.ReceiveIntegerR(4) != 5) ! throw new IOException("unexpected length of ReadyForQuery packet"); char tStatus = (char)pgStream.ReceiveChar(); if (Driver.logDebug) --- 1175,1181 ---- private void receiveRFQ() throws IOException { if (pgStream.ReceiveIntegerR(4) != 5) ! throw new IOException("unexpected length of ReadyForQuery message"); char tStatus = (char)pgStream.ReceiveChar(); if (Driver.logDebug) *************** *** 1193,1200 **** protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_FAILED); break; default: ! // Huh? ! break; } } --- 1193,1199 ---- protoConnection.setTransactionState(ProtocolConnection.TRANSACTION_FAILED); break; default: ! throw new IOException("unexpected transaction state in ReadyForQuery message: " + (int)tStatus); } }
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: patch: complain obviously about unknown transaction states
  2004-07-05 03:16 patch: complain obviously about unknown transaction states Oliver Jowett <oliver@opencloud.com>
@ 2004-07-09 23:58 ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2004-07-09 23:58 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-jdbc



On Mon, 5 Jul 2004, Oliver Jowett wrote:

> The attached patch makes the driver generate errors on unknown 
> transaction states in a ReadyForQuery message, rather than silently 
> ignoring them (and probably getting confused).
> 

Applied.

Kris Jurka




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-07-09 23:58 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-05 03:16 patch: complain obviously about unknown transaction states Oliver Jowett <oliver@opencloud.com>
2004-07-09 23:58 ` Kris Jurka <books@ejurka.com>

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