Connection Handling

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

1) Open one connection to the database and reuse the connection all
the time until i exit the system.
2) Open connection to the database, close the connection when the query
finish, reopen again the connection for another query and close it when
finish.
May i know which one is better for performance and which one is suggested to
be used and what is the pro and cons?

Thanks

regards,

florencelee
 
Flrencelee,

This is a simple answer, 2 and use dispose instead for close in this case,
the connection is that one of the exceptions for that.

(With exceptions to an MSAccess database when that should be locked to his
place on disk)

Reason is the connection pooling when there can be more than 100
simultanious connections.

I hope this helps?

Cor
 
Back
Top