.Net supports Connection Pooling just as Java does.

This is an old article, but might get you going -
http://www.sqlmag.com/Articles/ArticleID/38356/38356/pg/2/2.html?Ad=1

Essentially each app domain can contain one or more connection pools. A
connection pool is based on a unique connection string within an app domain.
So, for example

Web Service A has
Connection String X
Connection String Y

Assuming connection pooling is correctly setup,

When you open connection X, .Net will look for an already open connection
within the pool for Connection String X.

If one is found, it is returned, otherwise a connection is opened.

Now, when you call close on the connection, if pooling is enabled, the
connection isn't disposed, but rather returned to the pool. (various
timeouts can be specified for each pool).



On Wed, Oct 21, 2009 at 6:47 PM, B☼gus Excepti☼n <[email protected]>wrote:

>
> Consider:
>
> IIS 7
> Server 2008
> SQL Server 2005
> VS/VB.NET 2008
>
> How can I connect to the database on the above box from a WCF web
> service being served (again, on the same machine), in such a way that
> the application does not try to logon/connect to the database each
> time it is invoked?
>
> In Java we call it "Connection Pooling", where a connection is made
> once, and the app served has fast access once that initial connection
> is made. This has to do with abstracting the datasources, defining
> them separately from the applications themselves. In .NET, I notice
> that examples always show the connection being made from _inside_ the
> app, or service in this case.
>
> Will IIS 7 inherently know how to do this, or is there some
> combination of application and server settings needed to make this
> happen? Should a heavily used service have the connection in the app,
> or is there a way to create the .NET equivalent of a WebSphere,
> WebLogic/JBoss 'datasource'?
>
> I really looked today for answers before coming here, and maybe I've
> missed all the places this exists. I'm hoping some of you here have
> had to have a web service hammered that access a database...
>
> TIA!
>
> pat
> :)
>

Reply via email to