incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1215387 - in /incubator/lcf/branches/release-0.4-incubating-branch: ./ CHANGES.txt framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
Date Sat, 17 Dec 2011 02:55:26 GMT
Author: kwright
Date: Sat Dec 17 02:55:25 2011
New Revision: 1215387

URL: http://svn.apache.org/viewvc?rev=1215387&view=rev
Log:
Pull up fix for CONNECTORS-321.

Modified:
    incubator/lcf/branches/release-0.4-incubating-branch/   (props changed)
    incubator/lcf/branches/release-0.4-incubating-branch/CHANGES.txt
    incubator/lcf/branches/release-0.4-incubating-branch/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java

Propchange: incubator/lcf/branches/release-0.4-incubating-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Dec 17 02:55:25 2011
@@ -14,4 +14,4 @@
 /incubator/lcf/branches/CONNECTORS-290:1204836-1205502
 /incubator/lcf/branches/CONNECTORS-313:1213173-1214848
 /incubator/lcf/branches/CONNECTORS-32:1092556-1094216
-/incubator/lcf/trunk:1214045,1214707,1214850,1214893,1215025,1215091,1215096,1215099,1215269
+/incubator/lcf/trunk:1214045,1214707,1214850,1214893,1215025,1215091,1215096,1215099,1215269,1215386

Modified: incubator/lcf/branches/release-0.4-incubating-branch/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.4-incubating-branch/CHANGES.txt?rev=1215387&r1=1215386&r2=1215387&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.4-incubating-branch/CHANGES.txt (original)
+++ incubator/lcf/branches/release-0.4-incubating-branch/CHANGES.txt Sat Dec 17 02:55:25 2011
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 0.4-dev =====================
 
+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/branches/release-0.4-incubating-branch/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.4-incubating-branch/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java?rev=1215387&r1=1215386&r2=1215387&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.4-incubating-branch/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
(original)
+++ incubator/lcf/branches/release-0.4-incubating-branch/framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
Sat Dec 17 02:55:25 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);



Mime
View raw message