Return-Path: X-Original-To: apmail-incubator-connectors-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-connectors-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A4AE8741D for ; Sat, 17 Dec 2011 02:54:29 +0000 (UTC) Received: (qmail 58160 invoked by uid 500); 17 Dec 2011 02:54:29 -0000 Delivered-To: apmail-incubator-connectors-commits-archive@incubator.apache.org Received: (qmail 58097 invoked by uid 500); 17 Dec 2011 02:54:28 -0000 Mailing-List: contact connectors-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: connectors-dev@incubator.apache.org Delivered-To: mailing list connectors-commits@incubator.apache.org Received: (qmail 58089 invoked by uid 99); 17 Dec 2011 02:54:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Dec 2011 02:54:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Dec 2011 02:54:25 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F01CA2388860; Sat, 17 Dec 2011 02:54:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1215386 - in /incubator/lcf/trunk: CHANGES.txt framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java Date: Sat, 17 Dec 2011 02:54:04 -0000 To: connectors-commits@incubator.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111217025404.F01CA2388860@eris.apache.org> Author: kwright Date: Sat Dec 17 02:54:04 2011 New Revision: 1215386 URL: http://svn.apache.org/viewvc?rev=1215386&view=rev Log: Fix for CONNECTORS-321. Modified: incubator/lcf/trunk/CHANGES.txt incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java Modified: incubator/lcf/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/CHANGES.txt?rev=1215386&r1=1215385&r2=1215386&view=diff ============================================================================== --- incubator/lcf/trunk/CHANGES.txt (original) +++ incubator/lcf/trunk/CHANGES.txt Sat Dec 17 02:54:04 2011 @@ -8,6 +8,10 @@ CONNECTORS-324: Maven build broken ======================= Release 0.4 ========================= +CONNECTORS-321: Correct a problem with external HSQLDB databases +where the schema wasn't being reliably set for the session. +(Fred Toussi, Karl Wright) + CONNECTORS-319: Added a shutdown hook to the AgentRun command, so that if you ^C out of it you can rerun. (Karl Wright) Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java?rev=1215386&r1=1215385&r2=1215386&view=diff ============================================================================== --- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java (original) +++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java Sat Dec 17 02:54:04 2011 @@ -53,7 +53,6 @@ public class DBInterfaceHSQLDB extends D protected String cacheKey; protected int serializableDepth = 0; protected boolean isRemote; - protected String schemaName; protected String schemaNameForQueries; public DBInterfaceHSQLDB(IThreadContext tc, String databaseName, String userName, String password) @@ -65,34 +64,9 @@ public class DBInterfaceHSQLDB extends D this.userName = userName; this.password = password; if (this.isRemote) - { - schemaName = databaseName; schemaNameForQueries = databaseName; - } else - { - schemaName = null; schemaNameForQueries = "PUBLIC"; - } - } - - protected void setupSchema() - throws ManifoldCFException - { - if (schemaName != null) - { - String localSchemaName = schemaName; - schemaName = null; - try - { - performModification("SET SCHEMA "+localSchemaName,null,null); - localSchemaName = null; - } - finally - { - schemaName = localSchemaName; - } - } } protected static String getJDBCString(String databaseName) @@ -627,6 +601,8 @@ public class DBInterfaceHSQLDB extends D // Create the schema masterDatabase.executeQuery("CREATE SCHEMA "+databaseName+" AUTHORIZATION "+quoteString(userName),null, null,invalidateKeys,null,false,0,null,null); + masterDatabase.executeQuery("ALTER USER "+quoteString(userName)+" SET INITIAL SCHEMA "+databaseName,null, + null,invalidateKeys,null,false,0,null,null); } } else @@ -765,7 +741,6 @@ public class DBInterfaceHSQLDB extends D public void performModification(String query, List params, StringSet invalidateKeys) throws ManifoldCFException { - setupSchema(); try { executeQuery(query,params,null,invalidateKeys,null,false,0,null,null); @@ -932,7 +907,6 @@ public class DBInterfaceHSQLDB extends D public IResultSet performQuery(String query, List params, StringSet cacheKeys, String queryClass) throws ManifoldCFException { - setupSchema(); try { return executeQuery(query,params,cacheKeys,null,queryClass,true,-1,null,null); @@ -957,7 +931,6 @@ public class DBInterfaceHSQLDB extends D int maxResults, ILimitChecker returnLimit) throws ManifoldCFException { - setupSchema(); try { return executeQuery(query,params,cacheKeys,null,queryClass,true,maxResults,null,returnLimit); @@ -983,7 +956,6 @@ public class DBInterfaceHSQLDB extends D int maxResults, ResultSpecification resultSpec, ILimitChecker returnLimit) throws ManifoldCFException { - setupSchema(); try { return executeQuery(query,params,cacheKeys,null,queryClass,true,maxResults,resultSpec,returnLimit);