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: -Whether the underlying provider do connection pooling by default. -If I provide my own pooling then how will I know when to close the connection. At the moment I am registering with Thread.GetDomain().ProcessExit event and closing the connection when the event fires. Is this approach good?
The thing that is bothering me is that Entity Framework itself is closing connection. So I am a little hesitant to pool the connection or it may cause problems in some exceptional scenario.