import-bot (20211) [Avatar] Offline
#1
[Originally posted by cjuhng]

I don't clearly understand the section "30.4 SQL Server Connection Pooling"


You stated that in order to participate in the pool, the connection string
must be exactly same. The sample connection string contains user id =sa;
pwd=secret. What happens when the connection string is identical but with
a different user id and pwd? Then, is each user using a different pool?
Or use id and pwd can be different in each connection string yet still
participate in the same pool? I want to have each users use their user id
and pwd to login and use the same connection pool.

How can I list all user ids in a pool to see who are connected? A sample
code or a direction would be appreciated.

How can I generate a warning message to a user when his connection exceeds the
maximum pool size?
import-bot (20211) [Avatar] Offline
#2
Re: Connection Pool
[Originally posted by arlen]

If you log in with a different ID, then you are not sharing the same pool. The
connection strings really must be identical. The assumption is that this is a
server doing the connecting, not the individual users, so you are logging in
with a "server" id of some sort.

With the built-in pooling, you can't easily determine if the pool is full or
not (You _can_ set the timeout to a low value, then catch the exception as an
indication that the pool is full). Usually, though this is not what you would
want to do.

The idea is that a client connects to your server application, which gets a
connection, uses it to do some work, then releases the connection back to the
pool. It is important that you don't hold on to connections, so that users who
are blocked (waiting for a connection beyond the maximum) will not be blocked
for long.

Hope this helps,

Arlen
import-bot (20211) [Avatar] Offline
#3
Re: Connection Pool
[Originally posted by cjuhng]

Thank you for a quick response.

Your response clarified issues that I have been struggling with. It is nice
to have a built-in capability of connection pooling but, based on your
response, it has a limited practical usage when implementing a professional
distributed database application. Disappointed but I will have to seek out
other means to accomplish my objective of handling mutiple-user-logins sharing
a single connection pool.

Happy to able to ask a question directly to the author of the book that I
like! smilie