Connection pooling and process ids

  • Thread starter Thread starter Antonio Maciel
  • Start date Start date
A

Antonio Maciel

Hi.

I have read that with connection pooling we can reuse connections for better
performance. When I open a connection with a sql server database, I get a
process id. When I close that connection the process id is stored in the
pool together with other connection information? If another user gets my
connection from the pool, will he be using the same process id created by my
first connection?

Thanks,

Antonio Maciel
 
A connection pool cannot be used to share connections between different
processes - it is an in-process object. Hence, it isn't a lot of use when
the client program is connecting directly to the database server - you will
be sharing connections only with yourself!

Where it becomes useful is in a three-tier application where the middle-tier
process is connecting to the database on behalf of many users, and can
therefore service a lot of users with a few database connections.

There is no risk of your connection being re-used by another user or another
process.

Regards,

Neil McKechnie
 
Back
Top