Problems with TransactionScope and Oracle

后端 未结 6 1942
谎友^
谎友^ 2021-01-19 05:35

we have written a C# 3.5 client talking to an Oracle database (11g) using the ODP.NET.

This application has a batch process where a long running task is performed ma

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-19 06:35

    I know this is an old question but I'll add to it since I've seen this quite a bit.

    Are you using RAC? Have you worked with a DBA to see if you're experiencing locking/blocking. I've used System.Transactions with Oracle for years and the only time I've had similar issues is when we were using RAC and additional configuration needed to be done.

    Here's what happens: You start a transaction and are opening connections during the transaction (which is fine). However, the oracle service is not configured for distributed transaction processing (it's a simple checkbox option on the service). So additional connections start spanning more than one instance in the RAC cluster, and the related transactions are unaware of each other causing the .net process to block itself.

    It's a simple fix. The oracle service you are using just needs DTP enabled.

提交回复
热议问题