Skip to Main Content

DevOps, CI/CD and Automation

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!

Unable to enlist a distributed transaction after db restart

Slawek RosiekFeb 20 2013
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 20 2013
Added on Feb 20 2013
0 comments
2,312 views