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