-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: SQLStateConverter should pass sqlException.getNextException
PostPosted: Fri Feb 27, 2009 1:43 am 
Newbie

Joined: Thu Feb 26, 2009 11:00 pm
Posts: 2
Hibernate version: Hibernate 3.3.1.GA
Name and version of the database you are using:
PostgreSQL, version: 8.3.5
PostgreSQL Native Driver, version: PostgreSQL 8.3 JDBC4 with SSL (build 604)

Possible bug or something missed during an upgrade ... posting here first as requested before going to jira.

In SQLStateConverter#convert(SQLException, String, String), line 93, the statement
Code:
  String constraintName = extracter.extractConstraintName( sqlException );

should be modified to pass the nested exception
Code:
  String constraintName = extracter.extractConstraintName( sqlException.getNextException());

As it stands, extractConstraintName is trying to parse the message:
Quote:
Batch entry 0 insert into acme.metadata ([snip]) values ([snip]) was aborted. Call getNextException to see the cause.

... instead of:
Quote:
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "client_guid_idx"

... from the nested exception (which actually contains the constraint name).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.