we have an asp.net website which uses the Entity Framework 4 as ORM Mapper to a SQL Server.
The database functionality is located in an project that is compiled to an DLL, so it's not directly included in the web site.
We had several performance issues, so we are searching for a "magic switch" that decreases the time for materialization and other weaknesses.
I have a theoretical question:
Is it possible to run the entity framework project (the dll) in another thread then the website? I think of splitting the database work from the IIS worker thread. Or is it even possible to run the database worker (the dll) multiple times? (We are not using caching since it is not built in and we did not find an elegent solution.)
Thanks in advance
Edit: thanks for the answers, but I think my point was not clear enough.
I'm looking for a method to run the DLL of the Database functionality (that is used in nearly every .aspx(.vb) file) in a seperated thread. I have no idea how to run the dll at another thread, because it is just imported and not "started".
Would it be a solution to run a new thread before creating the context and create the context in the new thread?? The context is kept as long as the current httpcontext in our solution.