ITransactionLocal::StartTransaction method returns E_FAIL

Radovan Zach 1 Reputation point
2022-03-18T16:02:31.24+00:00

Hello,
an application I am providing support for uses OLE DB to connect to an MS SQL server.

An application user reported a defect which consists in the fact that a call to ITransactionLocal::StartTransaction method returns E_FAIL (A provider-specific error occurred.)

When the application detects the E_FAIL return code it attempts to retrieve the provider-specific error by calling GetErrorInfo function. The function GetErrorInfo, however, return S_FALSE (There was no error object to return.)

The problem in the application occurrs on various Windows OS versions (Windows 2008 and 2016) and various SQL Servers (SQL Server 2017 Standard and SQL Server 2005).

The application typically runs on multiple Windows machines. Several instances of the application typically connect to one MS SQL server instance. The only spefic condition I have been able to identify for the failure is the fact that at the time of its occurrence several instances of the application attempt to connect to the same MS SQL server. I would like to emphasize that the attempt to connect to an SQL server by several instances of the application is performed several times a day and most of the connection attempts succeed. Most succeed, but not all of them. Those which do nost succeed fail as described above.

What could cause the occasional StartTransaction method failure?

Thank you,
Radovan

SQL Server | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YufeiShao-msft 7,146 Reputation points
    2022-03-21T06:19:55.027+00:00

    Hi @Radovan Zach ,

    The ODBC Desktop Database Driver cannot start a transaction when it has a rowset open. The ODBC Provider returns E_FAIL if ITransactionLocal::StartTransaction is called when any rowset is held open by this driver. This limitation does not necessarily affect other ODBC drivers.
    Known Limitations of the OLE DB Provider for ODBC

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.