Forum Stats

  • 3,782,538 Users
  • 2,254,661 Discussions
  • 7,880,110 Comments

Discussions

ORA-02048: attempt to begin distributed transaction without logging on

9e20fbaa-33a4-4da7-9744-e735ff77b754
edited May 20, 2020 12:42PM in ODP.NET

This is an old topic ( ), but I'm still in trouble with it.

string connectionString = (new OracleConnectionStringBuilder()            {                UserID = "USER_TMP",                Password = "********",                DataSource = "localhost:1521/xe",                Pooling = true,                ConnectionTimeout = 15,                ConnectionLifeTime = 0            }).ConnectionString;// Looks like: USER ID=USER_TMP;POOLING=True;CONNECTION TIMEOUT=15;PASSWORD=********;DATA SOURCE=localhost:1521/xe;CONNECTION LIFETIME=0using (TransactionScope scope = new TransactionScope()){    using (OracleConnection cnx = new OracleConnection(connectionString))    {        cnx.Open(); // here occurs exception    }}

Database : Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product (something I can't change)

Nuget: Oracle.ManagedDataAccess (tried from 12.2.1100 to 19.7.0)

Framework: .Net 4.5.1

The only particular thing is that this code run on a different thread.

I don't really understand the exception message since I'm on a local database.

I also tried with these options to transaction:

using (TransactionScope scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))

using (TransactionScope scope = new TransactionScope(TransactionScopeOption.RequiresNew))
Tagged:

Answers