Home All Groups Group Topic Archive Search About

Determine if connection is from pool or newly opened

Author
3 Nov 2005 6:48 PM
stephen_barrett
We are using Oracle for our backend database.  We now have a need that
whenever a new connection is made to the Oracle database from our app,
we have to call a package function that is basically setting a
encryption/decryption key.  This only needs to be called once after a
new connection is open.

I am trying to figure out is if there is a way to determine if I get a
already opened pool connection or a newly opened connection when I call
ConnectionObject.Open().

If I can't determine if it is new or if it is from the pool, then I
have to call the package function everytime after .Open is called which
can get expensive.  Opening and closing of connections is handled in
our Data Access layer of our framework and developers don't really have
direct control of the open and close.

Is there a way to dermine if it is a new connection or pooled?  I am
wondering if I always get a pooled connection because under the covers
..net is searching for an available connection, if don't find open a new
one, add new to pool, and return connection from pool.  If this is the
case, I am probably stuck with having to make the call everytime.

Anyone know of way?

AddThis Social Bookmark Button