Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-1218

mixed scope-handling in CdiAppContextsService

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.0.1
    • 1.7.0
    • None
    • None

    Description

      CdiAppContextsService#destroyRequestContext calls
      #removeThreadLocals which also resets the ThreadLocal for the session-context -> scope handling is mixed.

      that causes issues once openejb is used for unit-tests and one test-method needs to simulate multiple requests and therefore uses

              this.contextControl.stopContext(RequestScoped.class);
              this.contextControl.startContext(RequestScoped.class);
      

      only with

              this.contextControl.stopContext(SessionScoped.class);
              this.contextControl.stopContext(RequestScoped.class);
              this.contextControl.startContext(RequestScoped.class);
              this.contextControl.startContext(SessionScoped.class);
      

      it's possible to prevent a ContextNotActiveException afterwards.
      however, that starts a new session-scope which might be problematic for the test (and looks strange anyway).

      Attachments

        Activity

          People

            romain.manni-bucau Romain Manni-Bucau
            gpetracek Gerhard Petracek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: