pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
SQLState of BatchUpdateException
2+ messages / 2 participants
[nested] [flat]

* SQLState of BatchUpdateException
@ 2009-05-26 04:00 Fujii Masao <masao.fujii@gmail.com>
  2009-05-27 23:56 ` Re: SQLState of BatchUpdateException Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Fujii Masao @ 2009-05-26 04:00 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

Unlike PSQLException, BatchUpdateException always doesn't haveSQLState.
This might cause unexpected behavior, e.g. fireConnectionError() would
misunderstand that the exception is fatal even if it's a mere transaction error.

Here is the patch to add SQLState into BatchUpdateException.

Thought?

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachments:

add_sqlstate.patch (application/octet-stream, 1.3K) download Index: org/postgresql/jdbc2/AbstractJdbc2Statement.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java,v retrieving revision 1.113 diff -c -r1.113 AbstractJdbc2Statement.java *** org/postgresql/jdbc2/AbstractJdbc2Statement.java 28 Jan 2009 09:50:21 -0000 1.113 --- org/postgresql/jdbc2/AbstractJdbc2Statement.java 25 May 2009 13:12:19 -0000 *************** *** 2569,2574 **** --- 2569,2575 ---- batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted. Call getNextException to see the cause.", new Object[]{ new Integer(resultIndex), queryString}), + newError.getSQLState(), successCounts); } *************** *** 2634,2639 **** --- 2635,2641 ---- batchException = new BatchUpdateException(GT.tr("Batch entry {0} {1} was aborted. Call getNextException to see the cause.", new Object[]{ new Integer(resultIndex), queryString}), + newError.getSQLState(), successCounts); }
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: SQLState of BatchUpdateException
  2009-05-26 04:00 SQLState of BatchUpdateException Fujii Masao <masao.fujii@gmail.com>
@ 2009-05-27 23:56 ` Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Kris Jurka @ 2009-05-27 23:56 UTC (permalink / raw)
  To: Fujii Masao <masao.fujii@gmail.com>; +Cc: pgsql-jdbc



On Tue, 26 May 2009, Fujii Masao wrote:

> Unlike PSQLException, BatchUpdateException always doesn't haveSQLState. 
> This might cause unexpected behavior, e.g. fireConnectionError() would 
> misunderstand that the exception is fatal even if it's a mere 
> transaction error.
>
> Here is the patch to add SQLState into BatchUpdateException.
>

Applied back to 8.0.  Thanks.

Kris Jurka




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


end of thread, other threads:[~2009-05-27 23:56 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-05-26 04:00 SQLState of BatchUpdateException Fujii Masao <masao.fujii@gmail.com>
2009-05-27 23:56 ` 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