You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2011/12/17 03:54:04 UTC
svn commit: r1215386 - in /incubator/lcf/trunk: CHANGES.txt
framework/core/src/main/java/org/apache/manifoldcf/core/database/DBInterfaceHSQLDB.java
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);