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

Avoid unneeded save() in UnrestrictedSessionRunner

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.6.0-HF22, 5.7.3
    • Component/s: Core
    • Upgrade notes:
      Hide

      Backported in 5.6.0-HF22 but only active if the property nuxeo.core.avoid-unneeded-save is true.

      Show
      Backported in 5.6.0-HF22 but only active if the property nuxeo.core.avoid-unneeded-save is true.

      Description

      Today UnrestrictedSessionRunner does a lot of save() operations to propagate invalidations between the base session and the unrestricted one, in order to allow both sessions to see the same object. This is actually not needed as soon as we run with a JCA pool (i.e. everywhere except non-pooling unit tests), so I'll fix the code to not do them if not needed (it was working before for JBoss but the code got lost somehow).

      A side effect is that unrestricted code that does session.query() and expect to see things not saved from the main session, or code where the unrestricted session does a change and the main session expects a query to see it, will not work anymore. Doing a save() before a query should be explicit in the code that needs it.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: