This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/magnolia-core/src/main/java/info/magnolia/repository/DefaultRepositoryManager.java b/magnolia-core/src/main/java/info/magnolia/reposi | |
| index cdfa55f..c90a72d 100644 | |
| --- a/magnolia-core/src/main/java/info/magnolia/repository/DefaultRepositoryManager.java | |
| +++ b/magnolia-core/src/main/java/info/magnolia/repository/DefaultRepositoryManager.java | |
| @@ -262,9 +262,14 @@ public final class DefaultRepositoryManager implements RepositoryManager { | |
| public void createWorkspace(String repository, String logicalWorkspaceName) throws RepositoryException { | |
| for (WorkspaceMappingDefinition mapping : workspaceMapping.getWorkspaceMappings()) { | |
| if (mapping.getRepositoryName().equals(repository)) { | |
| - Workspace workspace = getSystemSession(mapping.getLogicalWorkspaceName()).getWorkspace(); | |
| - workspace.createWorkspace(logicalWorkspaceName); | |
| - workspaceMapping.addWorkspaceMapping(new WorkspaceMappingDefinition(logicalWorkspaceName, repository, logicalWorkspaceName)); | |
| + Session session = getSystemSession(mapping.getLogicalWorkspaceName()); | |
| + try { | |
| + Workspace workspace = session.getWorkspace(); | |
| + workspace.createWorkspace(logicalWorkspaceName); | |
| + workspaceMapping.addWorkspaceMapping(new WorkspaceMappingDefinition(logicalWorkspaceName, repository, logicalWorkspaceName)); | |
| + } finally { | |
| + session.logout(); | |
| + } | |
| return; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment