Connection pooling fails .. why ?

  • Thread starter Thread starter Thue Tuxen Sørensen
  • Start date Start date
T

Thue Tuxen Sørensen

Hi all.

Ive written a class library called Datarepository, that takes care of all DB
access to an Sql server 2000
Ive then written a very small windows app to test the library.

I wont my app to be able to use the benefits of connection pooling.

When i use perfmon I can see that first time i open my app and fetches some
data, a conenction pool is created and a pooled connection is created.
If I close the app and opens it again, it wont use the connection in the
pool, it rather creates a new pool with a new connection.

Im using the exact same querystring.

Is it because that the context of the first instance (first time it opens)
of my app is somewhat different from the context of the second instance of
my app (second time it opens) ??

If this is the case, how will a web application behave when using my class
library ?
Will it not use connection pooling, because the objects in the library are
destroyed and created per page?

Best regards to all !

Thue Tuxen
 
Hi Thue,

Thue Tuxen Sørensen said:
Hi all.

Ive written a class library called Datarepository, that takes care of all DB
access to an Sql server 2000
Ive then written a very small windows app to test the library.

I wont my app to be able to use the benefits of connection pooling.

When i use perfmon I can see that first time i open my app and fetches some
data, a conenction pool is created and a pooled connection is created.
If I close the app and opens it again, it wont use the connection in the
pool, it rather creates a new pool with a new connection.

Im using the exact same querystring.

Connection pool is per app.
Otherwise, imagine ona app createing maximum number of connections and then
what?
No other app could create a connection anymore...
Is it because that the context of the first instance (first time it opens)
of my app is somewhat different from the context of the second instance of
my app (second time it opens) ??

If this is the case, how will a web application behave when using my class
library ?
Will it not use connection pooling, because the objects in the library are
destroyed and created per page?


You web app (assembly that is) is loaded on first access and remains
loaded - thus it will benefit from pooling.
It is not like closing a windows app.
 
Back
Top