ADO Connection (resource) pooling with COM+ transactions 
Author Message
 ADO Connection (resource) pooling with COM+ transactions

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



Sun, 11 Apr 2004 20:46:18 GMT  
 ADO Connection (resource) pooling with COM+ transactions
COM+ will take care of it and guarantee that your component behaves
transactionally.

--
Regards,
Eric Garza, MVP
Project manager
AMI GE


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



Mon, 12 Apr 2004 06:44:21 GMT  
 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



Mon, 12 Apr 2004 08:30:01 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ADO Connection (resource) pooling with COM+ transactions

2. ODBC Connection Pooling Vs OLE DB Resource Pooling

3. ODBC Connection Pooling Vs OLE DB Resource Pooling

4. ADO Connection Pooling in VB COM Component

5. Release ADO connection from a connection pool

6. ADO Connection Transaction vs. ObjectContext Transaction

7. Resource Pool and Competence Pool

8. Connection Pooling in COM+

9. Connection Pooling in COM+

10. Adding resources to Global Resource Pool

11. Resources in a resource pool in date range

12. Replace project resources with pool resources

 

 
Powered by phpBB® Forum Software