You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a multitenant application, using a multiple schema database approach. The context of my application is defined by the domain. So, I've a Doctrine listener that changes all entities schemas at runtime. The problem is I'm getting the following exception:
InactiveScopeException: You cannot create a service ("request") of an inactive scope ("request").
IMO, it seems like a contradiction. Once it is a http request, the request scope should not always be active? Furthermore, injecting the RouteContext, the returned host is localhost (the default value). I cant understand why the Context have not been initialized yet, once the request is one of the first things that is created:
The problem is that there can be sub-requests, and any service that depends on the request must be re-created for the scope of the sub-request. Then restored once the sub-request is completed. For this reason, any service that depends on any other request-scoped service must also be scoped to the request.
Long story short, afaik scoping your subscriber to the "request" scope should fix the problem.
Now that #7007 has been merged, you can just use a setter to get the request. It should fix your issues (the request context issue you mention should also be fixed now). Can you confirm and close this ticket?
Hello,
I'm working on a multitenant application, using a multiple schema database approach. The context of my application is defined by the domain. So, I've a Doctrine listener that changes all entities schemas at runtime. The problem is I'm getting the following exception:
Results in:
IMO, it seems like a contradiction. Once it is a http request, the request scope should not always be active? Furthermore, injecting the
RouteContext
, the returned host islocalhost
(the default value). I cant understand why the Context have not been initialized yet, once the request is one of the first things that is created:Is this a bug or an expected behavior?
The text was updated successfully, but these errors were encountered: