connection pooling with SQL Server

M

Mark

Where is the connection pooling done when using ADO.NET and SQL Server? On
the SQL Server or where the .NET run-time is being executed? I'm assuming
on SQL Server as this would minimize the number of connections needed in the
pool.

Thanks in advance.

Mark
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

"Pooling" means that a connection is kept open after you close it and is
reuser later, therefore both ends are involved. In the client it;s handle by
the provider and in the server by the SQL server, even as I thiink that all
of the pooling features are handled in the client, the server all it sees is
a open connection, it has no ideas if the connection is being used by the
app or just kept by the data provider.

Cheers,
 
©

©tefan ©imek

The connection pooling is performed just inside your application, by keeping
your disposed connections open and reattached the next time you request a
new connection with the same connection string.

As for the server, I can't imagine know how do you expect it to perform
connection pooling. The server usually only accepts connections and as such
is the passive element.

HTH,
Stefan
 
N

Nicholas Paldino [.NET/C# MVP]

Stefan,

Actually, this isn't correct. If you do a trace on SQL server in an
environment that uses connection pooling, you will notice that there is a
stored procedure that is called when the connection is retreived from the
pool named sp_reset_connection.

Hope this helps.
 
N

Nicholas Paldino [.NET/C# MVP]

That's the point though, if the SP is called on the server, then that
definitely alerts the server to something, no? =) It just resets the
session properties on the server end.
 
J

James Curran

Nicholas Paldino said:
That's the point though, if the SP is called on the server, then that
definitely alerts the server to something, no? =) It just resets the
session properties on the server end.

"Something", yes, but what? How would it know the different between a
connection being passed from one process to another, and a single process
doing multiple actions, and just calling that SP between them?

--
Truth,
James Curran
Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com
(note new day job!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top