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 Sat, 07 Mar 2015 02:59:38 GMT

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

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

Hi Abhinav,

To experiment with this problem in the client-server configuration, here's what you need to
do:

1) Start a Derby Network Server. If you've never done that before, check this link:
http://db.apache.org/derby/docs/10.11/getstart/twwdactivity4.html

2) Modify DERBY6773Repro.java to change the two places where it specifies a
JDBC connection URL so that they read:

    conn = DriverManager.getConnection("jdbc:derby://localhost:1527/edb;create=true");

and

                Connection conn = DriverManager.getConnection("jdbc:derby://localhost:1527/derbydb;create=true",
"sa", "sa");

3) When you run the program, you will have to set your CLASSPATH to be "derbyclient.jar"
rather than "derby.jar".

Meanwhile, I will have to research the "sealing violation". I only know a little bit about
this aspect of Java; it is a security mechanism to ensure that the Derby jars aren't
being tampered with. Since, in our case, we are intentionally changing the set of
class names that are correctly available outside of the jar file (by adding the new
DerbySQLIntegrityConstraintViolationException class), we will have to adjust the
sealing mechanism so that it knows that this new class is legally accessible from
outside the jar file.



> 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: 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