Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-24089

Introduce separate CloseableCoreSession interface to close session

    XMLWordPrintable

    Details

    • Type: Clean up
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.1
    • Component/s: Core
    • Impact type:
      API change
    • Upgrade notes:
      Hide

      The various CoreInstance.openCoreSession(...) methods now return a CloseableCoreSession, which has a close() method and can be use with the try-with-resources pattern.

      CoreSession.close() is deprecated and should not be used anymore.

      Any code previously calling CoreSession.close() has to be migrated to properly refer to the original CloseableCoreSession that was acquired, or, if the code flow is too complex, use a cast ((CloseableCoreSession) session).close().

      Show
      The various CoreInstance.openCoreSession(...) methods now return a CloseableCoreSession , which has a close() method and can be use with the try-with-resources pattern. CoreSession.close() is deprecated and should not be used anymore. Any code previously calling CoreSession.close() has to be migrated to properly refer to the original CloseableCoreSession that was acquired, or, if the code flow is too complex, use a cast ((CloseableCoreSession) session).close() .
    • Sprint:
      nxcore 10.1.1
    • Story Points:
      2

      Description

      Removing AutoCloseable from CoreSession and having a separate CloseableCoreSession interface helps clean up the code and make it more explicit.

      It also avoids having to add @SuppressWarnings("resource") in front of every call to doc.getCoreSession() because CoreSession doesn't implement Closeable anymore.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours
                2h

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.