Forum Stats

  • 3,782,538 Users
  • 2,254,661 Discussions


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

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 - 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))