How to create new objectcontext and all services use that objectcontext

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hello

I have requirement for importing products & setup it as per client requirement from CSV to nop.

CSV has around 50K records so its BIG.

On Plugin level i have created few tables with DATA ACCESS LAYER so i created customObjectContext at plugin level.

I have created the new plugin for it and done all the import logic as well and its importing as per requirement as well.

But now the issue is when we launch import it is very fast and import works great but when product count is reach around 2000 then import process is slowing down and it taking more time.

what i am assuming is its bcoz of Entity framework that occupies lots of resources for each entities

so what i am trying is to like after importing 1000 records i want to recreate the DBContext and want to use that for all nop services.

so after importing 1000 records if i can dispose the DBContext and create new one so it release all resources and start fresh import.

so what i want to do is i have already customObjectContext and it initializing on dependencyregister single time

so if anyone can help me to dispose and create new fresh objectcontext after importing 1000 records would be great.

other issue is IProductService will use the default nopObjectContext but i think we can override it to use customObjectContext from plugin dependencyregister.

any suggestion or help would be appreciated.
7 years ago
please input, suggestion or help would be appreciated
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.