Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-5625 JBoss5 integration
  3. NXP-5724

Fix Conccurency issue on DocumentManagerBean

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.4
    • Component/s: None
    • Upgrade notes:
      Hide

      In order to avoid any risk of reentrancy, synchronous Liseners that need to access the core session should never use CoreInstance.getInstance().getSession(doc.getSessionId).

      Possible options include :

      • taking the coreSession directly from the EventContext (that's what it was made for)
      • use doc.getCoreSession()
      Show
      In order to avoid any risk of reentrancy, synchronous Liseners that need to access the core session should never use CoreInstance.getInstance().getSession(doc.getSessionId). Possible options include : taking the coreSession directly from the EventContext (that's what it was made for) use doc.getCoreSession()

      Description

      As a Stateful Session Bean, DocumenManagerBean can no have concurrent calls : it is prohibited by the container.

      Since JBoss 5 is more stric that JBoss 4 about this, this raises an issue because of the way DocumenModelImpl and DocumentManagerBean interact.
      In some cases :
      1 - DocumentManagerBean uses DocumentModelImpl
      2 - DocumentModelImpl calls back the CoreSession (DocumentManagerbean) via CoreInstance.getInstance(SessionId)
      3 - this creates a reentrant call to DocumentManagerBean

      typical cases are :

      • DocumentManagerBean.createDocumenModel => AbstractSession.readModel => DocumenModelImpl.getParts => DocumenModelImpl.getDataModel => DocumentModelImpl.loadDataModel => DocumentManagerBean.getDataModel
      • DocumentManagerBean.something => AbstractSession.fireEvent => SomeListener using the session

      In all cases, these are not real concurrent call (only 1 thread), but it's a reentrancy call.
      Do not know if it's the desired behavior or a JBoss bug ...

        Attachments

          Activity

            People

            • Assignee:
              tdelprat Thierry Delprat
              Reporter:
              tdelprat Thierry Delprat
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: