none
System.Data.SqlClient.SqlConnection.Open() throwing exception on open to remote database RRS feed

  • Question

  •  

    I have a .NET WEB service on a Windows 2003 server attempting to open a connection to two databases running on separate Windows 2003 clusters.  Both opens are requested as part of a transaction initiated in a WEB method using the method attribute

     

    [WebMethod(TransactionOption=TransactionOption.RequiresNew)]

     

    I have configured MSDTC on all three machines and I have set the transaction mode on all machines to "Incoming Caller Authentication Required".  I have also tried "No Authentication" on all machines.

     

    If I add "enlist=false" to the connection strings or move the databases to the same machine as the web service the exception is not thrown.

     

    This is the exception returned from the open:

     

     System.Transactions.TransactionException: The transaction has already been implicitly or explicitly committed or aborted. ---> System.Runtime.InteropServices.COMException: The transaction has already been implicitly or explicitly committed or aborted (Exception from HRESULT: 0x8004D00E)
       at System.Transactions.Oletx.ITransactionShim.Export(UInt32 whereaboutsSize, Byte[] whereabouts, Int32& cookieIndex, UInt32& cookieSize, CoTaskMemHandle& cookieBuffer)
       at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
       --- End of inner exception stack trace ---
       at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException)
       at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
       at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
       at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
       at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)
       at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at Opt2Vote.DataAccessLayer.DBSession.openConnection(String connString, String uid, String pwd) in C:\Development\DotNet\IVote\DataAccessLayer\DBSession.cs:line 128
       at Opt2Vote.DataAccessLayer.DBSession.openConnection(DBName name) in C:\Development\DotNet\IVote\DataAccessLayer\DBSession.cs:line 155
       at TestService.TestDbUpdate(ServiceContext context)
       at TestService.TestWithTrans(String option, String parameters)
       --- End of inner exception stack trace ---
       at TestService.processException(ServiceContext context, String method, Exception e, String& retValue)
       at TestService.TestWithTrans(String option, String parameters)

     

    Any help is appreciated.

     

    Thanks

     

    Wednesday, June 27, 2007 9:05 PM