🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: microsoft.public.data.ado
1 messages
1 total messages Started by CRBD Wed, 03 Oct 2001 21:38
Problem with ADO, thread apartments, and Connections
#1
Author: CRBD
Date: Wed, 03 Oct 2001 21:38
29 lines
2498 bytes
Greetings,

In our application, we start two independent threads whose 
function is to open a connection to two different databases 
in two different machines. Each thread starts its own thread 
apartment, instantiates a Connection  object, and issues an 
Open() in the Connection. 

Our application requires at least one of the connections to 
be opened successfully. If the both databases are on-line, the 
Open() method returns quickly, but if one of the databases is 
off line, the Open() method can take almost a minute to return. 
The idea behind the two threads was to speed-up the 
initialization of the application when one of the databases was 
down or off line. Just take the first one that connects. For 
example, if one  database is on-line and the other is down, the 
application would take seconds to start, instead of waiting more 
than a minute, which would be the  case if we had to try to open 
both databases sequentially.

Unfortunately, our experiments have shown that ADO seems to be 
serializing the Open() requests, even though the threads, Connection 
objects, and apartments are completelly independent. In other words, 
the second Open() is executed only when the first one completed. 
This is quite puzzling!

Your comments and suggestions are greatly appreciated.

cd
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads