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).