Re: mishandling of NOTICE? - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: mishandling of NOTICE?
Date
Msg-id 006401c1ceb1$ee0f7c10$807ba8c0@inspiron
Whole thread Raw
In response to mishandling of NOTICE?  (Michael Adler <adler@glimpser.org>)
List pgsql-jdbc
Michael,

Try the development driver off the site, I had a look at the source and
it doesn't do this anymore.

Dave

> -----Original Message-----
> From: pgsql-jdbc-owner@postgresql.org
> [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Michael Adler
> Sent: Monday, March 18, 2002 1:47 PM
> To: PostgreSQL JDBC List
> Subject: [JDBC] mishandling of NOTICE?
>
>
>
> I am not very familiar with this driver, but I thought I
> should point out a potential bug. I wish I had time to do
> more investigationn, testing and debugging...
>
> I encountered a situation in which I could access the
> database using psql but not the JDBC driver. This is what I
> think happened:
>
> The backend issued a NOTICE message. psql handled it
> gracefully by printing the message to STDOUT and providing a
> fine connection. JDBC driver throws a fatal SQLException.
>
> The following case statements may need to handle NOTICEs differently:
>
> org.postgresql.Connection line 265:
>
>         // As of protocol version 2.0, we should now
> receive the cancellation key and the pid
>                 int beresp = pg_stream.ReceiveChar();
>                 switch (beresp)
>                 {
>                         case 'K':
>                                 pid = pg_stream.ReceiveInteger(4);
>                                 ckey = pg_stream.ReceiveInteger(4);
>                                 break;
>                         case 'E':
>                         case 'N':
>                                 throw new
> SQLException(pg_stream.ReceiveString(encoding));
>                         default:
>                                 throw new
> PSQLException("postgresql.con.setup");
>                 }
>
>                 // Expect ReadyForQuery packet
>                 beresp = pg_stream.ReceiveChar();
>                 switch (beresp)
>                 {
>                         case 'Z':
>                                 break;
>                         case 'E':
>                         case 'N':
>                                 throw new
> SQLException(pg_stream.ReceiveString(encoding));
>                         default:
>                                 throw new
> PSQLException("postgresql.con.setup");
>                 }
>
>
>
>
> Once again, sorry for the uninformed vaugeries. I hope this
> helps somewhat.
>
> Mike Adler
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to
> majordomo@postgresql.org)
>
>


pgsql-jdbc by date:

Previous
From: Michael Adler
Date:
Subject: mishandling of NOTICE?
Next
From: "Jan Aleman"
Date:
Subject: Strange timezone issue on Freebsd