[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1599) ConstraintViolationException returns null with PostgresDialect

Bruno Medeiros (JIRA) noreply at atlassian.com
Tue Dec 8 18:10:08 EST 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34901#action_34901 ] 

Bruno Medeiros commented on HHH-1599:
-------------------------------------

Sorry for the double post..

I've attached a file that I tried to apply the patches above. I don't remember why I didn't extend the default dialect, but I think it's not possible to apply the patches extending.
It's far from perfect, but at least shows the constraint.

It's doesn't seem that there's someone with free enough time to spent on this...

> ConstraintViolationException returns null with PostgresDialect
> --------------------------------------------------------------
>
>                 Key: HHH-1599
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1599
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1.3
>         Environment: Hibernate 3.1.3 , Postgres 8.1.2 (i686), postgresql-8.2dev-501.jdbc.jar
>            Reporter: Niclas Lindberg
>            Assignee: Diego Plentz
>            Priority: Minor
>         Attachments: HHH-1599-postgres-only.patch, HHH-1599.patch, PostgreSQLDialect.java
>
>   Original Estimate: 3 minutes
>  Remaining Estimate: 3 minutes
>
> ConstraintViolationException.getConstraintName() returns null. The problem is that the message being parsed comes from the SqlException that is the inputparameter to extractConstraintName(SqlException) in ViolatedConstraintNameExtracter. 
> Solution. The message provided by sqlException.getMessage() is "batch bla bla something" but the correct Exception message to parse is sqlException.getNextException().getMessage()

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list