I was debugging Jaroslaw Kowalski provider wrappers. While debugging it I observed that the Entity Framework closes the connection after every query. On every interaction with database, during the lifetime of application, a database connection is opened and after performing the query the connection is closed
My questions are:
The thing that is bothering me is that Entity Framework itself is closing the connection. So I am a little hesitant to pool the connection or it may cause problems in exceptional scenarios.
FYI:
The EF only closes connections it opens.
So if you do something like this manually:
((ctx.Connection as EntityConnection).StoreConnection as SqlConnection).Open();
subsequents queries and SaveChanges()
shouldn't close that connection.
Hope this helps
Alex