Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 96356 invoked from network); 21 May 2008 03:27:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 May 2008 03:27:17 -0000 Received: (qmail 3917 invoked by uid 500); 21 May 2008 03:27:18 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 3865 invoked by uid 500); 21 May 2008 03:27:18 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 3835 invoked by uid 99); 21 May 2008 03:27:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 May 2008 20:27:17 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 May 2008 03:26:39 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 91BF6234C118 for ; Tue, 20 May 2008 20:26:55 -0700 (PDT) Message-ID: <1958587584.1211340415592.JavaMail.jira@brutus> Date: Tue, 20 May 2008 20:26:55 -0700 (PDT) From: "Fay Wang (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Updated: (OPENJPA-605) Informix will throw an exception when a unique index is explictily created on the primary key columns In-Reply-To: <245484938.1211310595679.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-605?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Fay Wang updated OPENJPA-605: ----------------------------- Attachment: openjpa.patch This patch is per Pinaki's comments. > Informix will throw an exception when a unique index is explictily created on the primary key columns > ----------------------------------------------------------------------------------------------------- > > Key: OPENJPA-605 > URL: https://issues.apache.org/jira/browse/OPENJPA-605 > Project: OpenJPA > Issue Type: Bug > Reporter: Fay Wang > Attachments: openjpa.patch, openjpa.patch, openjpa.patch > > > When an entity is defined as following (unique index annotation on the primary key field. In this situation): > @Entity > @Table(name="AddressBean") > public class AddressBeanAno implements IAddressBean, Serializable { > @EmbeddedId > @Index(name="street_index",unique=true) > @Column(length=30) > private AddressPK street; > Informix will issue an error: > Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Index already exists on column. {stmnt 1440372186 CREATE UNIQUE INDEX street_index ON AddressBean (street)} [code=-350, state=S0011] > at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:192) > at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$3(LoggingConnectionDecorator.java:189) > at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingStatement.executeUpdate(LoggingConnectionDecorator.java:762) > at org.apache.openjpa.lib.jdbc.DelegatingStatement.executeUpdate(DelegatingStatement.java:114) > at org.apache.openjpa.jdbc.schema.SchemaTool.executeSQL(SchemaTool.java:1204) > at org.apache.openjpa.jdbc.schema.SchemaTool.createIndex(SchemaTool.java:1019) > at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:554) > at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:344) > at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:321) > at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:501) > Per Informaix SQL syntax guide (Create Index section): > You can not add a unique index to a column or column list that a primary -key constraint on it. The reason is that defining the column or column list as the primary key causes the database server to create a unique internal index on the column or column list. So you cannot create another unique index on this column or column list with CREATE INDEX statement. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.