Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C47B610C7A for ; Fri, 27 Feb 2015 23:09:09 +0000 (UTC) Received: (qmail 95945 invoked by uid 500); 27 Feb 2015 23:09:05 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 95917 invoked by uid 500); 27 Feb 2015 23:09:05 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 95906 invoked by uid 99); 27 Feb 2015 23:09:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Feb 2015 23:09:04 +0000 Date: Fri, 27 Feb 2015 23:09:04 +0000 (UTC) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6773) Derby throws plain SQLIntegrityConstraintViolationException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14340992#comment-14340992 ] Bryan Pendleton commented on DERBY-6773: ---------------------------------------- Here are three things that I think would be useful to do next: 1) Prototype a change that could fix this job. I think one thing to do would be to change engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java line 85 so that it generates a different exception instance, as suggested by Jochen. 2) Modify the repro program to turn it into a test case in one of the Derby test suites. Perhaps the suite ConstraintCharacteristicsTest would be a good place to add our new test cases. 3) Study the discussion notes that occurred among the Derby Developers last year regarding this situation: http://apache-database.10148.n7.nabble.com/Fwd-Duplicate-key-feature-request-tt143371.html Several important concerns were raised about how to address this request that we should study and understand. I think/hope that you could make headway on all of these separate courses of action and let me/us know what you think as you study the issue in more detail. > 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 > > > 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)