CompareWith function hangs
Rawden
Posts: 34 Bronze 2
Hi,
We have been using the following project to update our customer's DBs for a while now.
Download URL:
https://dl.dropboxusercontent.com/u/31635940/UpdateSchemaFromSnapshot.zip
Yesterday I loaded the SQL Compare application and it prompted that there were updates available, so I installed 10.7.0.18
Since then, (I'm not sure if it's related or not) the project in the zip file above is getting stuck when running the following line:
We have been using the following project to update our customer's DBs for a while now.
Download URL:
https://dl.dropboxusercontent.com/u/31635940/UpdateSchemaFromSnapshot.zip
Yesterday I loaded the SQL Compare application and it prompted that there were updates available, so I installed 10.7.0.18
Since then, (I'm not sure if it's related or not) the project in the zip file above is getting stuck when running the following line:
tblDiffs = dbSource.CompareWith(dbDest, Opts)How can I check which version of the SDK I have installed.... or if there is a newer one?
Comments
Specifically, in previous versions of the SQL Comparison SDK, comparison options were specified as a bit flags enum, like: In version 10.5, options are specified using the methods in the Options class, like: or
Hope that helps!
Red Gate Technical Support Engineer
Thanks for the reply. Very useful, but I'm pretty sure I'm doing all those things.
I've got a reference to RedGate.Shared.ComparisonInterfaces
I've changed my uses of 'DifferenceType'
I've tried the app with various option settings. Even just the default ones:
Did you manage to open my example project at all? You'd need to change the project's command-line arguments to point it to a test DB you have available. You'll also need to drop a snapshot file called snapshot.snp into the bin\debug folder.
I have tried this with multiple databases they all get stuck on that line. This was working fine before I updated the SQL Compare app the other day.
Kind Regards,
Rawden.
Just wondered if you'd had any further joy?
Regards,
Rawden.
Something in the CompareWith method is being held up by a deadlock in the UI thread.
If you look at the stacks for all threads, you can see the SDK code is waiting for the WaitHandle to be set, meanwhile you see multiple threads with waits fired by your StatusCallback sub.
If you comment out the entire StatusCallback sub, the code will run past the first status update fired by SDK. I am guessing you should check to see if you have InvokeRequired in that method?
I thought it was covered, as I was invoke checking in all the methods called by the StatusCallback sub (UpdateStatusText, SetProgressBar & AddStatusText)