Forum Stats

  • 3,767,816 Users
  • 2,252,720 Discussions
  • 7,874,335 Comments

Discussions

Unable to enlist a distributed transaction after db restart

Hi I have problem with enlist to distributed transaction after database restart.

My environment:
Windows 7 x64 with SP1
Oracle Database 11g Express Edition
ODP.NET 4.112.3.0

My program:

const string connectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=LOCALHOST)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XE)));User Id=system;Password=sasa;";

static void Main(string[] args)
{
using (TransactionScope scope = new TransactionScope())
{
while (true)
{
using (OracleConnection connection = new OracleConnection(connectionString))
{
try
{
connection.Open();
Console.WriteLine("Connection opened");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
Thread.Sleep(1000);
}
}
}

After stop database service and start it again i'm receiving error - Unable to enlist in a distributed transaction. What is the reason of that behavior?

BTW during database stop i'm receiving NullReferenceException on Open method.
This discussion has been closed.