Use an ole db database connection to access data in a distributed transaction (MSDTC)

Source: Internet
Author: User

When you access the ole db database in MSDTC, an exception is thrown. The exception information is: "Microsoft. Jet. oledb.4.0 ".ProgramThe itransactionlocal interface is not supported. Local transactions cannot be used by the current provider or fail to communicate with the basic transaction.

Originally, when creating an ole db database connection, the transaction is opened by default (automatic transaction enlistment), so if it is put in MSDTC, the above error will occur.

The solution is to disable automatic transaction processing of oledb by adding the following to the connection string:

Ole db services =-4;

In this way, not only the transaction is closed, but also the connection pool is closed. If frequent operations consume some performance, you must use them with caution!

A detailed list of available services is as follows:

Detailed introduction to ole db services in msdn: http://msdn.microsoft.com/en-us/library/ms717922 (V = vs.85). aspx

 

Another related Introduction: http://dcx.sybase.com/1200/en/dbprogramming/pg-oledb-oledb-conn-pool.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.