Experiencing IDBContext disposed / closed errors. Developing API. nop 4.3

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 anos atrás
Hello,

I've been maintaining an API on 4.3 for quite some time now. Due to a sudden influx of users, the site has been experiencing IDbContext disposed errors.

System.ObjectDisposedException: IDataContext is disposed, see https://github.com/linq2db/linq2db/wiki/Managing-data-connection
Object name: 'DataConnection'.


It usually happens when calls are done in quick succession or at the same time. I was able to get around this by applying a 10-50ms delay before firing the next request, but this isn't effective anymore.

I've read from another topic not to rely on the DI and use the EngineContext resolver instead, but this will require a bit of refactoring, which we do not have the resources for.

Is there another way to solve this?
2 anos atrás
Is this happening on your custom data access, or a built-in service?
2 anos atrás
Sorry for the very late reply.

It's custom data. Now I'm wondering where I made the mistake. What should I look into?
2 anos atrás
Fixed the problem by removing IRepository<> from DependencyInjection
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.