public SessionCache createSession(ExecutionContext context,
String workspaceName,
boolean readOnly) {
WorkspaceCache workspaceCache = workspace(workspaceName);
if (readOnly || workspaceCache.isExternal()) {
return new ReadOnlySessionCache(context, workspaceCache, sessionContext);
}
return new WritableSessionCache(context, workspaceCache, sessionContext);
}