none
Getting "a session is already in progress" exception while trying to synchronize after having failed previously due "no connection" exception RRS feed

  • Question

  • Hi,

    The scenario I have problem with is the following scenario: 

    I have SQL service 2008 rc2 as a localProvider and a SQL express as a RemoteProvider and the Orchestrator.Direction is SyncDirectionOrder.Download.

    *edit* Forgot to mention im using sync framework 2.1

    I try to synchronize the remote station while I have no connection to it and I get the no connection exception as expected.

    But later when the connection is restored if I try to synchronize it again I get the "a session is already in progress" exception.

    I copied the exceptions trace down below.

    In both of those synchronization I use the same SyncOrchestrator and the same SqlSyncProviders, I found out that if I create a new SqlSyncProvider for the remote station, it solve the problem but I wondered if there is another solution beside creating a new SqlSyncProvider?

    Thanks in advance,

    Zur

     

    The no connection exception:

    System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

     

       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()

       at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity)

       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject)

       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout)

       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)

       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)

       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)

       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)

       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)

       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)

       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 Microsoft.Synchronization.Data.SyncUtil.TryOpenConnection(IDbConnection connection)

       at Microsoft.Synchronization.Data.SyncUtil.OpenConnection(IDbConnection connection)

       at Microsoft.Synchronization.Data.SqlServer.SqlSyncSchemaInfoHandler.ReadSyncSchemaInfo(IDbConnection connection, IDbTransaction transaction, String objectPrefix, String objectSchema)

       at Microsoft.Synchronization.Data.SyncSchemaInfoHandlerBase.ReadSyncSchemaInfo(IDbConnection connection, String objectPrefix, String objectSchema)

       at Microsoft.Synchronization.Data.SqlServer.SqlManagementUtils.GetSyncSchemaInfo(IDbConnection connection, IDbTransaction trans, String objectPrefix, String objectSchema)

       at Microsoft.Synchronization.Data.SqlServer.SqlManagementUtils.VerifyRuntimeVersionExceedsSchema(SqlConnection connection, String objectPrefix, String objectSchema, Boolean throwWhenNotProvisioned)

       at Microsoft.Synchronization.Data.SqlServer.SqlSyncProvider.Configure()

       at Microsoft.Synchronization.Data.SqlServer.SqlSyncProvider.BeginSession(SyncProviderPosition position, SyncSessionContext syncSessionContext)

       at Microsoft.Synchronization.KnowledgeProviderProxy.BeginSession(SYNC_PROVIDER_ROLE providerRole, ISyncSessionState pSessionState)

       at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics)

       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, KnowledgeSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCallbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAdapter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32& changesApplied, Int32& changesFailed)

       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncProvider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied, Int32& changesFailed)

       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()

       at Microsoft.Synchronization.SyncOrchestrator.Synchronize()

       at My own code...

    The session is already in progress exception:

     

     

    Microsoft.Synchronization.Data.DbSyncException: The call to BeginSession() in RelationalSyncProvider is not valid. A session is already in progress.

       at Microsoft.Synchronization.Data.RelationalSyncProvider.BeginSession(SyncProviderPosition position, SyncSessionContext syncSessionContext)

       at Microsoft.Synchronization.Data.SqlServer.SqlSyncProvider.BeginSession(SyncProviderPosition position, SyncSessionContext syncSessionContext)

       at Microsoft.Synchronization.KnowledgeProviderProxy.BeginSession(SYNC_PROVIDER_ROLE providerRole, ISyncSessionState pSessionState)

       at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics)

       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, KnowledgeSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCallbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAdapter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32& changesApplied, Int32& changesFailed)

       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncProvider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied, Int32& changesFailed)

       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()

       at Microsoft.Synchronization.SyncOrchestrator.Synchronize()

       at my own code...

     


    Zur
    Tuesday, January 25, 2011 4:23 PM

Answers

  • Hi zur,

    thanks for reporting this to us. this was a known issue in the provider with the current release. as you already stated, rebuild a new sqlsyncprovider or restart the sync application can workaroud this issue.

    again, sorry for the inconvenience and thanks for reporting this to us.

    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Proposed as answer by Yunwen BaiModerator Tuesday, January 25, 2011 8:49 PM
    • Marked as answer by Zur Magen Wednesday, January 26, 2011 8:05 AM
    Tuesday, January 25, 2011 8:48 PM
    Moderator

All replies

  • Hi zur,

    thanks for reporting this to us. this was a known issue in the provider with the current release. as you already stated, rebuild a new sqlsyncprovider or restart the sync application can workaroud this issue.

    again, sorry for the inconvenience and thanks for reporting this to us.

    Yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Proposed as answer by Yunwen BaiModerator Tuesday, January 25, 2011 8:49 PM
    • Marked as answer by Zur Magen Wednesday, January 26, 2011 8:05 AM
    Tuesday, January 25, 2011 8:48 PM
    Moderator
  • Hi Yunwen,

    Thank you for your fast respond, is there some place where I can see the updated known issue for the current release?

    I looked at "Release Notes for Microsoft Sync Framework 2.1 08/11/2010 16:57:49" and could not find it in there.

    Regards,

    Zur


    Zur
    Wednesday, January 26, 2011 8:47 AM
  • the known issues usually were mentioned in the release note based on how widely the issue will affect the users. this particular one is not there.

    thanks

    yunwen


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, January 26, 2011 7:53 PM
    Moderator