db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6773) Derby throws plain SQLIntegrityConstraintViolationException
Date Wed, 22 Apr 2015 01:15:59 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14506185#comment-14506185
] 

Bryan Pendleton commented on DERBY-6773:
----------------------------------------

Hi Abhinav, that is good to hear. 

I was thinking we could usefully break this project into multiple sub-tasks. That
way, we could subdivide the work that is done into separate portions and
keep the patches small and easier to review and commit.

Perhaps, the sub-tasks could be:
1) Implement the new DerbySQLIntegrityConstraintViolationException class
2) Implement the new MessageUtils clas
3) Change DRDAConnThread and MessageService in the engine to call MessageUtils
4) Change Sqlca and SqlException in the client to call MessageUtils
5) Change SQLExceptionFactory in both the server and client to throw the
    new DerbySQLIntegrityConstraitViolationException
6) Add the new regression test demonstrating that the new exception can be
   caught and examined in both embedded and client-server configurations

The advantage of this approach is that it is incremental; the system will be fully
functional after each step, and so we can make progress toward the final
solution one step at a time.

Of course, we will have to have a good detailed understanding of steps (3) and (4)
in order to successfully build the MessageUtils class in step (2).

I will open sub-tasks of this issue, so that when you get some time, you can
start building the individual separate patches and attach them to the sub-tasks.

> 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: 10.10.2.0
>         Environment: Windows 7 x86_64, Java 1.6.0.45
>            Reporter: Jochen Wiedmann
>            Assignee: Abhinav Gupta
>            Priority: Minor
>         Attachments: CallSuper.diff, DERBY6733Repro.java, SamePackage.diff, SharedException.diff,
ant -verbose build all.txt, generateOnClientDoesntWork.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
(v6.3.4#6332)

Mime
View raw message