
ADO Connection (resource) pooling with COM+ transactions
I'd like to add that there is no thing like "waisting connections". maybe
there will be some additional connections opened but if you have a
reasonable workload on the server, these also will be pooled and your
components will get a pooled connection.
Only when a connection has not been used for a certain period of time, the
connection will be dropped from the pool.
What I am trying to say is: The fact that you are working in a 3 tiered
manne, using COM+, will guarantee you the most economic workload on the
server.
The alternative is to keep the connections alive in your component with the
disadvantage that another client will not be able to use that connection
that would have been pooled if you didn't.
The way you are implementing this is good: Get in, make a connection, do
your stuff, close the connection and get out.
regards,
Evert
=======================================
My email address has been altered to
avoid unwanted email.
Replies to the newsgroup only, please.
Thanks,
Evert Timmer:
Transworld Software
VC++, VB6, SQL Server Database Solutions
http://www.transworld-software.com (under construction)
=======================================
Quote:
> Hi all,
> Can somebody help me out here; I haven't been able to find an answer
> to this anywhere ...
> I have a 3-tier COM+ application, written in VB, using SQL Server 7.
> My database access is with ADO, using the native OLE DB driver for SQL
> Server. My question concerns resource pooling (which I believe is the
> OLE DB equivalent to ODBC connection pooling). What happens to ADO
> Connections that are opened within a transaction? I have a series of
> methods that I want to call in sequence, all within the same
> transaction. Each one opens a new connection, and then subsequently
> closes it. For example:
> begin transactional method
> begin method 1
> new connection 1
> execute database operation
> close connection 1
> end method 1
> begin method 2
> new connection 2
> execute database operation
> close connection 2
> end method 2
> begin method 3
> new connection 3
> execute database operation
> close connection 3
> end method 3
> end transactional method
> Am I "waisting" connections? Are all three of these connections going
> to be tied up for the duration of the transaction? Will other
> transactions be able to use connection 1 while I'm using connection 2
> (since I'm already finished with 1), or will it be unavailable? I
> don't want to tie up multiple connections from the pool for a single
> transaction. Will connections be released back to the pool once
> they've been closed, or only when the transaction ends?
> I'd greatly appreciate any input anyone can offer!
> Cheers,
> Greg