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 Fri, 06 Mar 2015 14:58:38 GMT

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

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

Perhaps if we were to place our new exception class into 

    org.apache.derby.shared.common.error.DerbySQLIntegrityConstraintViolationException

in trunk/java/shared/org/apache/derby/shared/common/error,
then we could reference that from both instances of SQLExceptionFactory:
- the one in trunk/java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java
- and the one in trunk/java/client/org/apache/derby/client/am/SQLExceptionFactory.java

I'm not super-familiar with the way that the code in the 'shared' subdirectory is packaged
into both the derby.jar and derbyclient.jar packages, but I think it's supposed to be
able to work this way.

Would this address the concerns that Knut Anders raised here:
http://apache-database.10148.n7.nabble.com/Fwd-Duplicate-key-feature-request-tp143371p143392.html


> 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: Bryan Pendleton
>            Priority: Minor
>         Attachments: DERBY6733Repro.java, SamePackage.diff, ant -verbose build all.txt
>
>
> 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