Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

9e20fbaa-33a4-4da7-9744-e735ff77b754May 11 2020 — edited May 20 2020

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=0

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

Comments

Post Details

Added on May 11 2020
1 comment
554 views