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] [Commented] (DERBY-6773) Derby throws plain SQLIntegrityConstraintViolationException
Date Mon, 02 Mar 2015 18:58:04 GMT

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

Abhinav Gupta commented on DERBY-6773:

Hi Bryan,

I was studying the code and Jochen had suggested to add methods like
getConstraintName(). What I understand is that to add that functionality, I
will have to write another exception class that extends the
SQLIntegrityConstraintViolationException, with the methods that Jochen had
suggested and then create an instance of the new exception class at line 85
of the SQLExceptionFactory.java.

But I'm not sure how will the getConstraintName(), getTableName() methods
get the reference of the table/ constraint. How should I pass the reference
to the new exception class. Do I pass it with the exception, when the
Exception occurs during the execution of the command in
EmbeddedPreparedStatement.java ?

And I suppose the new tests cases will be added after I am able to
implement the new exception class, right ?

On Sat, Feb 28, 2015 at 4:39 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: DERBY6733Repro.java
> 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