Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 12815 invoked from network); 16 Aug 2007 20:39:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Aug 2007 20:39:59 -0000 Received: (qmail 74403 invoked by uid 500); 16 Aug 2007 20:39:55 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 74384 invoked by uid 500); 16 Aug 2007 20:39:55 -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 74363 invoked by uid 99); 16 Aug 2007 20:39:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 13:39:55 -0700 X-ASF-Spam-Status: No, hits=-99.8 required=10.0 tests=ALL_TRUSTED,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 20:39:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 580F471420B for ; Thu, 16 Aug 2007 13:39:31 -0700 (PDT) Message-ID: <6811627.1187296771356.JavaMail.jira@brutus> Date: Thu, 16 Aug 2007 13:39:31 -0700 (PDT) From: "Kevin Sutter (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-320) Do not use System Tables (SYS*) with DB2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Do not use System Tables (SYS*) with DB2 ---------------------------------------- Key: OPENJPA-320 URL: https://issues.apache.org/jira/browse/OPENJPA-320 Project: OpenJPA Issue Type: Bug Components: jdbc Affects Versions: 0.9.7 Reporter: Kevin Sutter Assignee: Kevin Sutter Fix For: 1.0.0 DB2's system tables (schemas beginning with SYS*) are causing problems with the JPA CTS bucket, if we're trying to use the SynchronizeMappings feature. >From our dev mailing list (http://www.nabble.com/Null-schema-name-when-generating-tables--tf4280146.html): ====================================================== We're running the CTS TCK against DB2 and we've hit a snag with the SynchronizeMappings feature (I know this is not a required aspect of the TCK, but that's what we have been using to create the tables for the testing). One of the tests in the TCK requires a table called DATATYPES. The problem is that DB2 has a system table by this name, so when OpenJPA attempts to look up any existing table information, we accidentally find the system table (SYSCAT) instead of the user's table (cts1). The following trace snippet shows the problem. 1000 JPATCK TRACE [main] openjpa.jdbc.Schema - Reading table information for schema name "null", table name "DATATYPES". 1000 JPATCK TRACE [main] openjpa.jdbc.JDBC - [0 ms] rollback 1000 JPATCK TRACE [main] openjpa.jdbc.JDBC - getColumns: null, null, DATATYPES, null 1500 JPATCK TRACE [main] openjpa.jdbc.Schema - Reading column information for table " SYSCAT.DATATYPES". Of course, this goes on thinking that we have found an appropriate DATATYPES table definition, but later when we attempt to alter it, we get an error: 1891 JPATCK TRACE [main] openjpa.jdbc.SQL - executing stmnt 854733554 ALTER TABLE DATATYPES ADD id INTEGER 1891 JPATCK TRACE [main] openjpa.jdbc.SQL - [0 ms] spent 1891 JPATCK TRACE [main] openjpa.jdbc.JDBC - [0 ms] close org.apache.openjpa.persistence.PersistenceException: DB2 SQL error: SQLCODE: -204, SQLSTATE: 42704, SQLERRMC: CTS1.DATATYPES {stmnt 854733554 ALTER TABLE DATATYPES ADD id INTEGER} [code=-204, state=42704] ====================================================== By examining and experimenting with OpenJPA, it looks like we have a mechanism already in place to skip over these type of system tables. By setting the variable systemSchemas with the names of these DB2-specific schema names, then we can bypass these tables and avoid the problem. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.