Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 91476 invoked from network); 11 Nov 2010 14:23:06 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Nov 2010 14:23:06 -0000 Received: (qmail 11235 invoked by uid 500); 11 Nov 2010 14:23:37 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 11200 invoked by uid 500); 11 Nov 2010 14:23:37 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 10470 invoked by uid 99); 11 Nov 2010 14:23:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Nov 2010 14:23:35 +0000 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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Nov 2010 14:23:35 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oABENE6q018424 for ; Thu, 11 Nov 2010 14:23:15 GMT Message-ID: <28703514.26261289485394938.JavaMail.jira@thor> Date: Thu, 11 Nov 2010 09:23:14 -0500 (EST) From: "Jose Marcos Gomes (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Created: (JCR-2810) Error creating DB2 table for Journaling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Error creating DB2 table for Journaling --------------------------------------- Key: JCR-2810 URL: https://issues.apache.org/jira/browse/JCR-2810 Project: Jackrabbit Content Repository Issue Type: Bug Components: clustering, jackrabbit-core Affects Versions: 2.1.2, 2.1.1 Environment: Persisting the journal to DB2 database Reporter: Jose Marcos Gomes Hi guys, First of all, congratulations for the fantastic job. I'm deploying a Jackrattbit-JCA resource adapter to a clustered Websphere environment and using a DB2 for storing data and realized some missing code to add DB2 support. Here is: JACKRABBIT-CORE, @ org.apache.jackrabbit.core.util.db, method guessValidationQuery (the last one), I adjusted as follows to add a DB2 validation query: ---------------------------------------------------------------------------------------------------------- private String guessValidationQuery(String url) { if (url.contains("derby")) { return "values(1)"; } else if (url.contains("mysql")) { return "select 1"; } else if (url.contains("sqlserver") || url.contains("jtds")) { return "select 1"; } else if (url.contains("oracle")) { return "select 'validationQuery' from dual"; } else if (url.contains("h2")) { return "select 1"; } else if (url.contains("db2")) { return "values(1)"; } log.warn("Failed to guess validation query for URL " + url); return null; ---------------------------------------------------------------------------------------------------------- And as a final touch, a DDL to build the tables: JACKRABBIT-CORE, @ src/main/resources/org/apache/jackrabbit/core/journal, added a file named db2.dll as follows (actually I copied this from derby.dll) ---------------------------------------------------------------------------------------------------------- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. create table ${schemaObjectPrefix}JOURNAL (REVISION_ID BIGINT NOT NULL, JOURNAL_ID varchar(255), PRODUCER_ID varchar(255), REVISION_DATA blob) create unique index ${schemaObjectPrefix}JOURNAL_IDX on ${schemaObjectPrefix}JOURNAL (REVISION_ID) create table ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID BIGINT NOT NULL) create unique index ${schemaObjectPrefix}GLOBAL_REVISION_IDX on ${schemaObjectPrefix}GLOBAL_REVISION (REVISION_ID) create table ${schemaObjectPrefix}LOCAL_REVISIONS (JOURNAL_ID varchar(255) NOT NULL, REVISION_ID BIGINT NOT NULL) # Inserting the one and only revision counter record now helps avoiding race conditions insert into ${schemaObjectPrefix}GLOBAL_REVISION VALUES(0) ---------------------------------------------------------------------------------------------------------- Best regards, J Marcos -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.