Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I try  use the Microsoft.Synchronization.SyncOrchestrator.Synchronize() for Mirror my source database instance To my destination database(using sql server 2014, VS 2017).

Always I can see successfully end of Synchronize(), When the Synchronization is First time.

But After I change the scopeName , Sometimes The Synchronize() function don't end, never.
When the Source Database is small(around 10mb), the Synchronize() was ended successfully, after minutes with changing scopeName.
But When the Source Database is large(around 3gb), the Synchronize() was not ended never.
There is No Any Exception Message, just never end.

Is there problem the Microsoft.Synchronization framework with Bigger database ?
My PC is notebook - with inter i5 2.5GHz and 8GB Ram.

What I have tried:

VB
Dim scopeName As String = "TheScopeName"
'after end of first syncro, I will do again syncro Just change the scopeName.
'
Dim SourceConnectionString As String
Dim TargetConnectionString As String

SourceConnectionString = s_src
TargetConnectionString = s_dst

Dim sqlServerConn As SqlConnection = New SqlConnection(SourceConnectionString)
Dim sqlAzureConn As SqlConnection = New SqlConnection(TargetConnectionString)

Dim myScope = New DbSyncScopeDescription(scopeName)

'.....get table list for syncro...
'
Dim sqlServerProv As SqlSyncScopeProvisioning = New SqlSyncScopeProvisioning(sqlServerConn, myScope)

If (sqlServerProv.ScopeExists(scopeName) = False) Then
 sqlServerProv.Apply()
End If

Dim sqlAzureProv As SqlSyncScopeProvisioning = New SqlSyncScopeProvisioning(sqlAzureConn, myScope)

If (sqlAzureProv.ScopeExists(scopeName) = False) Then
 sqlAzureProv.Apply()
End If

Dim syncOrchestrator As SyncOrchestrator = New SyncOrchestrator

syncOrchestrator.LocalProvider = New SqlSyncProvider(scopeName, sqlAzureConn)
syncOrchestrator.RemoteProvider = New SqlSyncProvider(scopeName, sqlServerConn)
syncOrchestrator.Direction = SyncDirectionOrder.UploadAndDownload

syncOrchestrator.Synchronize()
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900