• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 773
  • Last Modified:

.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

0
adelaidecrow
Asked:
adelaidecrow
1 Solution
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now