It's bad design that leveraging singleton design pattern in db connection

Refer to http://stackoverflow.com/questions/814206/getting-db-connection-through-singleton-class

You won't be able to open multiple SqlDataReaders/Commands with the connection at the same time and will run into thread blocking issues if you are trying to share the same connection object with multiple threads.

If you are attempting to avoid a performance hit of "new SqlConnection()" or "connection.Open()" be advised that there really is no performance hit there because of the connection pooling going on behind the scenes. Connection Pooling handles the opening/closing of the expensive connections. Not the SqlConnection object.

原文地址:https://www.cnblogs.com/webglcn/p/2668767.html