Issue with TransactionScope when transaction is in aborted state
996039Mar 11 2013 — edited Mar 26 2013I have problems using TransactionScope with Odp provider.
In general it works with no problems, but when I have situation that is Transaction.Current in aborted state, commands like ExecuteNonQuery do not consider TransactionScope and immediately commits work to database.
I also tried with last release of Oracle Data Provider - ODAC 11.2 Release 5.
In ConnectionString I use setting "PROMOTABLE TRANSACTION=LOCAL" for local transactions.
Simple example:
try {
using (TransactionScope loScope = new TransactionScope()) {
OracleConnection loCon = new OracleConnection(lsConnectionString);
loCon.Open();
//do some work ... work do not succeeded successfully
Transaction.Current.Rollback();
//Transaction is in aborted state
//do some other work ...
OracleCommand loCom = new OracleCommand("update TAK_TASK set STATE='SU' where tsk_id = 50", loCon);
loCom.ExecuteNonQuery();
// ExecuteNonQuery immediately commits update in database
loCon.Close();
loScope.Complete();
}
}
Does anyone else have the same problem?
Is there any solution for this case?