ORA-02041: client database did not begin a transaction

时间:2023-03-09 15:33:50
ORA-02041: client database did not begin a transaction

.NET中访问Oracle数据库链接:ORA-02041: client database did not begin a transaction 问题的处理。

.NET中访问Oracle中带有DB_LINK时对象时,会抛出一下异常
ORA-02041: client database did not begin a transaction
解决方案:
1.

To resolve the issue with Oracle's ODP.NET, you'd specify "enlist=false" in your connect string.

Microsoft's ODP.net has the same connection string attribute, but it does something different.  I think what you want to use with system.data.oracleclient is OmitOracleConnectionName.

See also http://forums.oracle.com/forums/thread.jspa?messageID=2281429&#2281429

2.

To Resolve this problem, you only have to include "Omit Oracle Connection Name=True;" in your connection string, for example:

"User Id=MyUser;Password=MyPassword;Data Source=MyDB;Omit Oracle Connection Name=True;"