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!

Issue with TransactionScope when transaction is in aborted state

996039Mar 11 2013 — edited Mar 26 2013
I 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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 23 2013
Added on Mar 11 2013
3 comments
1,209 views