From: Aron Roberts Date: Fri, 14 Mar 2014 01:54:08 +0000 (-0700) Subject: CSPACE-6340: Updated the ID Service to use an instance-qualified database name, rathe... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=615d8604eb43fb36a185b927650fcb434236425c;p=tmp%2Fjakarta-migration.git CSPACE-6340: Updated the ID Service to use an instance-qualified database name, rather than assuming that the repository name matches the database name. --- diff --git a/services/id/service/src/main/java/org/collectionspace/services/id/IDResource.java b/services/id/service/src/main/java/org/collectionspace/services/id/IDResource.java index 0a7b042a3..dd3e9987f 100644 --- a/services/id/service/src/main/java/org/collectionspace/services/id/IDResource.java +++ b/services/id/service/src/main/java/org/collectionspace/services/id/IDResource.java @@ -390,7 +390,7 @@ public class IDResource extends AbstractCollectionSpaceResourceImpl in getJdbcConnection"); Connection conn = null; try { - conn = JDBCTools.getConnection(JDBCTools.NUXEO_DATASOURCE_NAME, repositoryName); + conn = JDBCTools.getConnection(JDBCTools.NUXEO_DATASOURCE_NAME, databaseName); } catch (NamingException e) { throw e; } catch (SQLException e) { @@ -978,7 +989,8 @@ public class IDServiceJdbcImpl implements IDService { Connection conn = null; try { - conn = getJdbcConnection(ctx.getRepositoryName()); + String repositoryName = ctx.getRepositoryName(); + conn = getJdbcConnection(getDatabaseName(repositoryName)); // Retrieve a list of tables in the current database. final String CATALOG_NAME = null; @@ -1013,4 +1025,8 @@ public class IDServiceJdbcImpl implements IDService { } } + + private String getDatabaseName(String repositoryName) { + return JDBCTools.getDatabaseName(repositoryName, CSPACE_INSTANCE_ID); + } }