code: public SessionCache createSession(ExecutionContext context,
              String workspaceName,
              boolean readOnly) {
          WorkspaceCache workspaceCache = workspace(workspaceName);
          if (readOnly) {
              return new ReadOnlySessionCache(context, workspaceCache);
          }
          return new WritableSessionCache(context, workspaceCache, txWorkspaceCaches, repositoryEnvironment);
      }
docs: Create a session for the workspace with the given name, using the supplied ExecutionContext for the session.
  
  @param context the context for the new session; may not be null
  @param workspaceName the name of the workspace; may not be null
  @param readOnly true if the session is to be read-only
  @return the new session that supports writes; never null
  @throws WorkspaceNotFoundException if no such workspace exists