.Net Transaction Scope and Oracle Proxy Authentication

We have a .Net application that has been upgraded recently to make use of Oracle Proxy Authentication. This allows us to use a proxy user in the connection string- passing through the current users credentials for auditing purposes etc.

The problem we are facing is when combined with Transaction Scope in .Net, updating always produces a TransactionAbortedException. This does not happen with the same source code if we are not using a proxy user in the connection string.

Our transaction code is attached.

Dim transactionOptions1 As New Transactions.TransactionOptions()
    transactionOptions1.IsolationLevel = Transactions.IsolationLevel.ReadUncommitted
    transactionOptions1.Timeout = New TimeSpan(0, 0, 60)

Using transactionScope As New Transactions.TransactionScope(System.Transactions.TransactionScopeOption.Required, transactionOptions1, Transactions.EnterpriseServicesInteropOption.Full)

Try

        Me.SaveObject(businessObject, fieldMappings, tableNameComparer)

' some specific OracleExceptions were not causing an TransactionAbortedException on transactionScope.Complete(). Throwing a generic Exception fixes the issue.

      Catch oEx As Oracle.DataAccess.Client.OracleException

        Throw New Exception(oEx.Message)

      Catch ex As Exception

        'Do nothing - transactionScope.Dispose (i.e. End Using) will trigger a TransactionAbortedException to be handled outside BusinessObjectBaseClasses

      Finally

        'commit/rollback
        transactionScope.Complete()

      End Try

    End Using

Open in new window

adelaidecrowAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

adelaidecrowAuthor Commented:
We've managed to solve this internally. It was a bug with the ODP.net provider.

The following link touches on the same issue:

http://forums.oracle.com/forums/thread.jspa?threadID=541132&tstart=0

A workaround solution is to ensure that the connection to the database is not closed until after the TransactionScope is completed.
0
EE_AutoDeleterCommented:
adelaidecrow,
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.