Groups | Blog | Home
all groups > sql server clients > september 2007 >

sql server clients : Best connection management


Hornet77
9/7/2007 12:00:00 AM
Hi all

I'm developing a software written in c# (.NET 2.0) with a SQL server
2005 database. I have 3 modules that need to access database:

- a simple ASP.NET website receiving event from remote devices via https
calls

- a windows service running 24/7 that act as a server

- a winform application running as a client with user interface,
launched by the user

3 modules use .NET remoting to communicate.

In order to query DB actually I'm using a single connection for each
module, always opened (for the ASP.NET site I use a static instance of
my "dbManager" class)... when I neeed to query the database I use the
already opened connection and leave it opened for further operation.

Is this acceptable? what kind of problems can cause? Should I use
another approach (open and close connection for every operation)?

Ekrem_Önsoy
9/7/2007 12:00:00 AM
It depends on your hardware resources (especially RAM) on your SQL Server
server.

--
Ekrem Önsoy
MCBDA, MCTS: SQL Server 2005, MCSD.Net, MCSE, MCT



[quoted text, click to view]
Hornet77
9/7/2007 12:00:00 AM
Hi Ekrem

thanks for your help ;-)

Ekrem Önsoy ha scritto:
[quoted text, click to view]

tipically the SQL server will run on a Windows Server 2003r2 with 1 GB
of RAM....

but there is no good practice to follow, to prescind from hardware?

Bye
Ekrem_Önsoy
9/7/2007 12:00:00 AM
Hi,


SQL Server allocates 28KB regardless for every connection. If there are too
many clients to connect to the SQL Server, then you should think about this
method again.

To be able to consider carefully, you may want to analyze your system by
using System Monitor and adding counters for CPU and RAM especially.

Openning and Closing connections may have a performance cost for your
application, but sometimes Availability is more important than performance.
You of course may add some more memory or tune your application's
performance if you encounter a problem about RAM.

It always depends :)

--
Ekrem Önsoy
MCBDA, MCTS: SQL Server 2005, MCSD.Net, MCSE, MCT



[quoted text, click to view]
AddThis Social Bookmark Button