Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3249

clarify/tune RepositoryService lifecycle

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Spent some time with a caching issue in my RepositoryService, only to find out that the lifecycle of the service is not necessarily the same as the one of the JCR2SPI RepositoryImpl.

      See

      public Session login(Credentials credentials, String workspaceName) throws LoginException, NoSuchWorkspaceException, RepositoryException {
      SessionInfo info = config.getRepositoryService().obtain(credentials, workspaceName);
      try {
      if (info instanceof XASessionInfo)

      { return new XASessionImpl((XASessionInfo) info, this, config); }

      else

      { return new SessionImpl(info, this, config); }

      } catch (RepositoryException ex)

      { config.getRepositoryService().dispose(info); throw ex; }

      }

      So unless the RepositoryConfig caches the service, a new one will be built for each new JCR session.

      Is this intentional? In which case we should augment the Javadoc. Otherwise it might be good to change it to have a one-to-ine relation between Repository and RepositoryService...

      Attachments

        Activity

          People

            Unassigned Unassigned
            reschke Julian Reschke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: