SQL CONNECTION best practices

It is currently being discussed which pros and cons of a single sql connection architecture.

To develop what we are discussing, when creating an application, we open the sql connection and when you close the application we close or close the sql connection. And without creating another connection at all, but using only one to talk to the database.

We are interested in what the community thinks.

+5
source share
6 answers

Close the connection as soon as you no longer need it for undefined time. In this case, the connection is returned to the connection pool (if the connection pool is enabled) and can be (re) used by someone else.

(Connections are expensive resources and sometimes limited).

, ( , ), , x , ....

. ado.net

+9

... .

+7

, .

  • 10 000 , , 10 000
  • Sql, 10 000 , - - 10000 .

1, , , , , . Sql Server, 10 001, 10 001 . / , , , , , , .

+2

ADO.NET . , . - .

+1

Richmond Systems, , , . , , . , . .

, , .

+1

, . , , , .

, , - , , , . "" - , . , , , . , - , ? - . , , .

+1
source

All Articles