Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 57376 invoked from network); 21 Jul 2008 19:39:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jul 2008 19:39:55 -0000 Received: (qmail 60573 invoked by uid 500); 21 Jul 2008 19:39:54 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 60537 invoked by uid 500); 21 Jul 2008 19:39:54 -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 60526 invoked by uid 99); 21 Jul 2008 19:39:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jul 2008 12:39:53 -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; Mon, 21 Jul 2008 19:39:08 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id AC87C234C173 for ; Mon, 21 Jul 2008 12:39:33 -0700 (PDT) Message-ID: <893858087.1216669173705.JavaMail.jira@brutus> Date: Mon, 21 Jul 2008 12:39:33 -0700 (PDT) From: "Jeremy Bauer (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-663) Index creation fails when default schema does not exist MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Index creation fails when default schema does not exist ------------------------------------------------------- Key: OPENJPA-663 URL: https://issues.apache.org/jira/browse/OPENJPA-663 Project: OpenJPA Issue Type: Bug Components: sql Affects Versions: 1.2.0 Environment: DB2 for iSeries / i5/OS. Toolkit for Java JDBC driver. Reporter: Jeremy Bauer I have an entity which uses the org.apache.openjpa.persistence.jdbc.Index annotation to specify an index on a field. When running against DB2 on iSeries with the Toolkit for Java JDBC driver, the mapping tool is failing with an internal SQLException when issuing the SQL to create the index. Here is the exception output: org.apache.openjpa.persistence.PersistenceException: [SQL0204] MYUID in QSYS type *LIB not found. {stmnt 1135625136 CREATE UNIQUE INDEX projid_index ON myschema.ProjectBean (projid)} [code=-204, state=42704] Investigation determined that the problem is due to not specifying a default library on the JDBC URL (myschema) and using a user login that does not have a matching schema defined. Neither are a requirement for iSeries. The JDBC driver chooses the user profile name as the default schema. Unlike DB2 on LUW, the schema name will not get created by default (or as the result of another CREATE which uses the schema name) on iSeries, resulting in the error above. Unlike most other annotations, the Index annotation does not allow a schema to be specified. In addition, the openjpa.jdbc.Schema property does not affect index generation. Since (at least on iSeries) indexes can be created in a specific schema, the Index annotation should be enhanced to include an attribute which allows specification of the schema name to use when creating the index. This problem was found when using DB2 on iSeries, but could occur using any database/JDBC driver which behaves similarly. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.