[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2890) Hibernate cannot wrap HSQLDB constraint violations exceptions
Gail Badner (JIRA)
noreply at atlassian.com
Thu Oct 25 01:09:38 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28554 ]
Gail Badner commented on HHH-2890:
----------------------------------
This looks like a hsqldb JDBC bug.
This seems to be a problem when the delete is executed in a batch. In this case, hsqldb JDBC throws java.sql.BatchUpdateException, with a cause set to the same exception, SQLState set to null, and venderCode set to 0.
Hibernate cannot determine that the batch failed due to a constraint violation because the SQLState is null.
When batching is disabled (by setting hibernate.jdbc.batch_size to 0), Hibernate correctly throws ConstraintViolationException.
> Hibernate cannot wrap HSQLDB constraint violations exceptions
> -------------------------------------------------------------
>
> Key: HHH-2890
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2890
> Project: Hibernate3
> Issue Type: Sub-task
> Components: core
> Affects Versions: 3.2.1
> Reporter: Baptiste MATHUS
> Priority: Minor
> Attachments: UnitTestConstraintBug.zip
>
>
> Since I can't attach a file to a bug that hasn't been logged by me. I'll create a sub-bug, since logging a bug was anyway something I planned to do when I created the testcase.
> In the attached zip, you'll find a project that has two entities: Customer and Invoice. An Invoice references a Customer. I show that trying to delete a Customer that's referenced by an invoice doesn't throw a ConstraintViolationException with HSQLDB (1.8.0.7 or 1.7.3.3 gives the same result).
> The testcase is in the test package.
> I hope this helps tackle the problem. Before logging a bug in the HSQL tracker, I'd really appreciate to have your opinion. Shoud I do it?
> FYI, I tested the very same code on Oracle, and the ConstraintViolationException is very well thrown...
--
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