db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abhinav Gupta (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6773) Derby throws plain SQLIntegrityConstraintViolationException
Date Mon, 18 May 2015 20:57:00 GMT

     [ https://issues.apache.org/jira/browse/DERBY-6773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Abhinav Gupta updated DERBY-6773:
    Attachment: subPart1.diff

Hi Bryan,

I was working on the subtasks that you had created, for the first task I
built on the premise of your patch CallSuper.diff and created a new class
of DerbyIntegrityViolationConstraintException in the shared/common/errors
directory. I have attached the patch for the same subPart1.diff.

For the second subtask, I studied the Derby-1178 and the patch
bug1178_rev1.diff. The gist of this subtask is clear to me, but it took me
a while to understand how it's being implemented. And this is what I
understood, there is a function wrapArgsForTransportAcrossDRDA() that
creates a dummy SQLException for serializing the arguments, which we then
pass to the SQLException as a Throwable cause, that ferries it to the
The other function getArgumentFerry ()  checks if the exception is an
instance of DerbyIntegrityViolationConstraintException and returns the
cause containing the arguments.

Based on my understanding, I've implemented the MessageUtils class that
implements these two functions. So that we can create a dummy exception
containing the arguments and then decode it on the client side. I've
attached the subPart2.diff patch for this.
Could you please have a look ?

Thank you for your time :)

On Wed, Apr 22, 2015 at 7:04 AM, Bryan Pendleton (JIRA) <jira@apache.org>

> Derby throws plain SQLIntegrityConstraintViolationException
> -----------------------------------------------------------
>                 Key: DERBY-6773
>                 URL: https://issues.apache.org/jira/browse/DERBY-6773
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions:
>         Environment: Windows 7 x86_64, Java
>            Reporter: Jochen Wiedmann
>            Assignee: Abhinav Gupta
>            Priority: Minor
>         Attachments: CallSuper.diff, DERBY6733Repro.java, SamePackage.diff, SharedException.diff,
ant -verbose build all.txt, generateOnClientDoesntWork.diff, subPart1.diff, subPart2.diff
> If a unique constraint is violated by an insert statement, then Derby throws an SQLIntegrityConstraintViolationException.
The error message contains, in particular, the constraint name and the table name.
> To distinguish between cases with various constraints, Derby should instead throw a subclass
of SQLIntegrityConstraintViolationException, with methods like getConstraintName(), and getTableName().
> See also https://hibernate.atlassian.net/browse/HHH-9516.

This message was sent by Atlassian JIRA

View raw message