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

Clean up session management

    XMLWordPrintable

    Details

    • Type: Clean up
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.9.3
    • Component/s: Core
    • Tags:
    • Upgrade notes:
      Hide

      To acquire a CoreSession (which should rarely be done in any case), you should now use the following pattern:

      try (CoreSession session = CoreInstance.openCoreSession(repositoryName))

      { // do something with session, including session.save() }

      To do an explicit close if try-with-resource is not used as above, you should just call:

      session.close();

      CoreInstance has a few other openCoreSession signatures to acquire a session for a given user or a system session.

      Show
      To acquire a CoreSession (which should rarely be done in any case), you should now use the following pattern: try (CoreSession session = CoreInstance.openCoreSession(repositoryName)) { // do something with session, including session.save() } To do an explicit close if try-with-resource is not used as above, you should just call: session.close(); CoreInstance has a few other openCoreSession signatures to acquire a session for a given user or a system session.
    • Sprint:
      Sprint 1(5.9.3)

      Description

      CoreSession does not contain any state besides the Session (connection to the database), but this session is closed at transaction end so in effect there's no point in keeping a CoreSession beyond a transaction boundary.

      This allows up to clean up many things related to management of session ids.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 3 days
                  3d
                  Remaining:
                  Remaining Estimate - 3 days
                  3d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified