TNS name required for transactions with Oracle. Why?

Thread is closed for posting
2 posts, 0 answers
  1. Greg
    Greg avatar
    44 posts
    Member since:
    Jun 2012

    Posted 06 Aug 2013 Link to this post

    I'm getting the following exception when calling OpenAccess.FlushChanges() inside a TransactionScope using an Oracle backend:
    You must use TNS names for participating in System.Transactions. Unable to
    enlist a database connection in a System.Transactions.Transaction
       at Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e)
       at OpenAccessRuntime.ExceptionWrapper.Throw()
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.handleException(Exception x, Boolean needsRollback)
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.flushRetainState()
       at OpenAccessRuntime.DataObjects.OpenAccessPersistenceManagerImp.flush(Boolean retainValuesParam)
       at OpenAccessRuntime.DataObjects.UnsynchronizedPMProxy.flush(Boolean retainState)
       at OpenAccessRuntime.EnlistableObjectScope.FlushChanges(Boolean releaseMemory)
       at Telerik.OpenAccess.OpenAccessContextBase.FlushChanges(Boolean releaseMemory)
       at Telerik.OpenAccess.OpenAccessContextBase.FlushChanges()

    It seems that this check is hardcoded in OracleFactory.Enlist just before delegating the enlistment to OracleConnection.EnlistTransaction. I've been using ODP.NET without TNS and with System.Transactions for ages and it doesn't require TNS names in the connection string. Why is this limitation in place?
  2. Ralph Waldenmaier
    Ralph Waldenmaier avatar
    202 posts

    Posted 06 Aug 2013 Link to this post

    Hi Greg,

    The check is based on limitations in very early version of the Oracle .NET driver. This limitation is no longer needed and will be removed in future versions of the product. 
    You can workaround this by using EZCONNECT to connect to your Oracle database in case you want to avoid having an TNS setup. See this link for details. See the section 'EZCONNECT Setup'.

    Thank you for bringing this to our attention and please accept my apologies for the inconvenience this might cause to you.
    Do not hesitate to ask in case you have any other question.

    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
Back to Top