Hi @ismcagdas,
Thanks for the response.
Unfortunately, I don't think that will work us. It looks like I would need to inject IServiceProvider into dependencies, which would be the Service Locator pattern. I consider that pattern to be an anti-pattern.
I was under the impression that MsScopedLifestyleManager would work for ASP.NET Core, but If I look at the source code it seems that there is no active / current scope.
I will investigate if I can implement a custom lifestyle manager based on HttpContext.
Regards, Justin
Prerequisites What is your product version? 11.3
What is your product type (Angular or MVC)? Angular
What is product framework type (.net framework or .net core)? .NET Core
If issue related with ABP Framework What is ABP Framework version? 7.3
If issue is about UI Which theme are you using? Default What are the theme settings? Default
Hi,
The framework supports Transient and Singleton lifestyles for dependencies. I have a domain service whose lifestyle I would like to configure to be Per Request, as this domain service is heavily used and I want to reduce the number of unneccessary instantations of this domain service for each request.
I've tried this but it does not work. The dependency still behaves as Transient.
Please advise on how I can configure dependencies to be per request.
Thank you, Justin
Hi,
Can I please get some feedback on this?
Thank you
Hi,
Sometimes, not always, we have users who have been inactive for a couple of days, who then try to login and receive a "An internal error occurred during the request" error. When looking at the AuditLogs I see "Refresh token is not valid!" errors.
The problem is when then the user gets this error they are unable to login, even if they capture their credentials correctly. I have to get them to us a private / incognito window to login or to clear their browser cache. This is not a very good user experience.
My questions are as follows:
As I mentioned, this only happens sometimes and only to some users.
Below are screenshots the user sent me when trying to login
When looking at the logs I see this:
Exception System.ComponentModel.DataAnnotations.ValidationException: Refresh token is not valid! at RMS.Web.Controllers.TokenAuthController.RefreshToken(String refreshToken) in /src/src/RMS.Web.Core/Controllers/TokenAuthController.cs:line 263 at lambda_method14159(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.
Parameters {"refreshToken":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1laWRlbnRpZmllciI6IjIwIiwiaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvd3MvMjAwNS8wNS9pZGVudGl0eS9jbGFpbXMvbmFtZSI6IlJhbWFrZ29sbyIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL2VtYWlsYWRkcmVzcyI6InJhbWFrZ29sby5sZWthbGFrYWxhQHVsLmFjLnphIiwiQXNwTmV0LklkZW50aXR5LlNlY3VyaXR5U3RhbXAiOiJTUEdXT1JPQk5LUEgyV1FOT041VExBVFZDVUpWS1BTRiIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6WyJSZXNlYXJjaCBPZmZpY2UgT2ZmaWNpYWwiLCIwOTc4YzljY2Q0ZTA0NTgxYTMwZGFiYmYzYzJiZTU4ZiIsImQwNWFmYmYwOTI2YjQyYTRiOWQ2ZmRiOTVhMjQzMDNhIl0sImh0dHA6Ly93d3cuYXNwbmV0Ym9pbGVycGxhdGUuY29tL2lkZW50aXR5L2NsYWltcy90ZW5hbnRJZCI6IjIwIiwic3ViIjoiMjAiLCJqdGkiOiI2OTY1ZWJjNy0zMDFiLTQ2MGEtOTRiMy01YzhiZGI3Y2QwYTciLCJpYXQiOjE2NTgzMjEwMzgsInRva2VuX3ZhbGlkaXR5X2tleSI6IjZhYjU0N2VmLTI5YzQtNGM1ZS1hZDQxLTU1NWRlYmU3ZjNkNCIsInVzZXJfaWRlbnRpZmllciI6IjIwQDIwIiwidG9rZW5fdHlwZSI6IjEiLCJuYmY...
Thank you, Justin
Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
Hi there,
Why is it necesary to call Complete() on a UnitOfWork before it get's disposed? What if you're executing multiple CRUD commands in a UnitOfWork and one of them throws an exception, and you don't want the other commands to commit their changes?
With a normal TransactionScope, if you don't want any changes in the scope to commit, you simply prevent calling Complete() on that transaction scope.
But ABP is forcing me to call Complete() on the UnitOfWork, even thought I don't want to commit the changes. This is counter intuitive. If I don't call Complete before the UnitOfWork disposes, it will throw an exception.
Secondly, If I look at the EntityFramework implementation for UnitOfWork in ABP, EfUnitOfWork, the Complete and CompleteAsync try to commit the changes on the transaction. This is not what I want or expect to happen. There should be no changes committed
Please see the two screenshots below and advise. Thank you
Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
We're are using Redis as the cache store for ICacheManager. The problem is, some of our forms are quite complex and have many lookups that fetch lookup options via an API. This API uses the ICacheManager to retrieve cached lookup values. Occasionally, we get timeout issues with ICacheManager trying to establish a connection to Redis. We're tried multiple Redis configurations and have even tried using Azure Redis as a dedicated service but we're still getting the same timeout error. Below is a screenshot of the error. I'd like to know if you've encountered this issue before or if you can recommend a solution. Thank you.