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

TransientRepository can shut down early when Session.impersonate() is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.17.5
    • None
    • jackrabbit-core
    • None

    Description

      The org.apache.jackrabbit.core.TransientRepository class assumes that the only way to open a new Session is the login() method, and only monitors calls to this method when tracking open sessions and deciding when to shut down.

      There is, however, a second way of opening a new Session, by calling Session.impersonate(). TransientRepository has no knowledge of such Session instances, and will shut down when only impersonated sessions remain open. This doesn't happen in practice, but can happen during unit testing scenarios where only a small number of sessions is active.

      This can be worked around by wrapping the returned Session instances into an instance that can monitor impersonate() calls and notify the repository about successful impersonations. It also needs to wrap the result of impersonate() because it's allowed to further impersonate an impersonated session. I'm not familiar with the code base, though, so there may be a better way to get notified about impersonation calls.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Csaba Varga Csaba Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: