Article ID: 193095 - Last Review: March 14, 2005 - Revision: 1.1 PRB: Transactions and ADO Parameters Cause Connections to HangThis article was previously published under Q193095 On This PageSYMPTOMS
If you try to populate an ActiveX Data Objects (ADO) command object's
parameters collection, automatically from within a transaction, other
connections to the same SQL Server hang if they attempt to modify
information in the system tables of the TempDB database.
This behavior only occurs if you use the default ODBC provider for ADO in conjunction with SQL Server version 6.5. CAUSE
When an application attempts to populate the parameters collection of an
ADO command object automatically, it queries the system tables of the SQL
Server database for parameter-specific information (such as the total
number of parameters, the type of each parameter, the direction of each
parameter, and so forth). This information is returned to the calling
application through a temporary table created in the TempDB database of SQL
Server. The creation of a temporary table adds a record to the system
tables of the TempDB database.
If this is done from within a transaction, the addition of a record to the system tables of the TempDB database results in the system tables of the TempDB database being locked until the transaction has been either committed or rolled back. If a process on another connection to the SQL Server attempts to modify the information in the system tables of the TempDB database, while the database is locked by a preceding process, the process hangs until the transaction is completed. RESOLUTION
To avoid this behavior, you can implement either of the following two
programming concepts:
STATUS
This behavior is by design.
MORE INFORMATION
The following Visual Basic sample code demonstrates the hanging behavior
described in the SYMPTOMS section. This behavior can also be seen in other
ADO-compliant programming languages such as Java and Visual C++.
Note that the following sample application hangs when executed and needs to be terminated through the Task Manager window. Steps to Reproduce Behavior
REFERENCES
For additional information about Refreshing ADO Parameters for stored procedures, please see the following
article in the Microsoft Knowledge Base:
174223
(http://support.microsoft.com/kb/174223/EN-US/
)
HOWTO: Refresh ADO Parameters for a Stored Procedure
APPLIES TO
| Article Translations
|


Back to the top
