. Net to access the Oracle database link: ORA-02041: client database did not begin a transaction problem.

Source: Internet
Author: User
. Net to access the Oracle database link: ORA-02041: client database did not begin a transaction problem. . Net to access the Oracle database link: ORA-02041: client database did not begin a transaction problem.

. When accessing the object with db_link in Oracle, it will throw an exception ORA-02041: client database did not begin a transaction means to set a transaction, however, the simple begintransaction does not seem to solve the problem. Code
Dgis_sp_mis_workflow uses an object in the database link.
(Update operations are not tested for read-only instances ):

Oraclecommand command =NewOraclecommand ();

Oracleconnection1.open ();

Command. Connection = oracleconnection1;

Command. Transaction = oracleconnection1.begintransaction (isolationlevel. readcommitted );

Command. commandtext = "SET transaction read only ";

Oracledatareader oradr = command. executereader ();

Command. commandtext = "select * From dgis_sp_mis_workflow ";

 

Oracledataadapter ODA =NewOracledataadapter ();

 

Datatable dttable =NewDatatable ();

ODA. selectcommand = command;

ODA. Fill (dttable );

Dbgrid1.datasource = dttable;

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.