I have read that ASP.NET uses connection pooling to manage database connections so it is not inefficient to open and close database connections on a per request basis. I assume this for SQL Server. What about for MySQL using the .NET connecter?
I am building a D.A.L. and I am basically wondering if I should open and close db connections in each function or if I should keep a connection open until the class is cleaned up and use Disposable/Finalize to ensure the db connection is closed.
Always go for pooling if you can – the largest cost in (simple) database access is always opening and closing a connection.
The NET Connector supports pooling. And take note: