Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6.0.1
-
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).