none
Generating deprovisioning script (SqlSyncScopeDeprovisioning.ScriptDeprovisionScope) timeout exception. RRS feed

  • Question

  • Hi there,

    We are using the Sync Framework 2.1 along with SQL server 2008, .Net 3.5 and SQL CE.

    We have provisioned our server DB for multiple scopes. One of those scopes uses the filtering feature that was introduced in 2.1. We are working on the implementation to take care of the schema changes that may happen to the tables part of sync once the product goes live. The workaround that we have found is to de-provision DB > execute schema change scripts > provision DB

    While trying to de-provision the dB, I'm using the SqlSyncScopeDeprovisioning.ScriptDeprovisionScope to generate the script as a file and execute it manually. But while trying to execute the ScriptDeprovisionScope, I've getting the timeout exception and I see that its happening after 30 seconds, which is the default timeout for the ADO.Net. I've set the timeout explicitly to 180 seconds for both my connection string as well as the CommandTimeout property of SqlsyncScopeDeprovisioning; but to no avail. I see that the total execution time for the script (for which the exception is thrown) when I run it manually is around 1min 30 sec.

    Any pointers to a possible cause would be grateful!

    Regards,

    Ron.

    [Note: We are generating the script and not directly deprovisioning as the former gives us more control on the process.]

     

    Thursday, April 14, 2011 5:24 PM

Answers

  • You can adjust the CommondTimeOut value according to the amount of data you want to deprovision to handle the timeout issues during directly deprovisioning.

     

    As previous post mentioned, there is a bug in the code to generate scripts for deprovision where the CommandTimeout value isn’t used.

     

    To workaround this, you could consider split the tables into smaller sync groups.  Or you could make a copy of your database, drop objects which are not needed for sync in this copy , then generate the scripts against this copy of database. The objects Sync needs include tables and PK constraint.  


    Ann Tang
    Thursday, April 21, 2011 8:14 PM

All replies

  • peeking at the code, SqlSyncScopeDeprovisioning.ScriptDeprovisionScope does not pick up/use the CommandTimeout property value.
    Friday, April 15, 2011 10:53 AM
    Moderator
  • June, thanks for your reply. Could there be a workaround for this scenario?
    Friday, April 15, 2011 2:07 PM
  • not that i could think of within the framework as only ScriptDeprovisionTemplate appears to be using the CommandTimeout set.

    if i may ask, what is it that you do to the deprovisioning script rather than having Sync Fx do the deprovisioning itself?

    how many tables do you have in the scope that it takes 1.5 min to deprovision?

    Friday, April 15, 2011 2:48 PM
    Moderator
  • Well, primarily because

    • We would rather like to run the script in production environment once we have QC'd it in staging,
    • we encountered timeouts while doing provisioning directly in some environments,
    • we would like to modify the script to delete some additional objects that we created for getting the sync working and I believe the error messaging is better while running from studio which would help in troubleshooting.

    We have around 60 tables in our scope. The script which gets timed out is the one that tries to fetch the SPs and Triggers that have been created for Sync which is 928 objects in total.

    Friday, April 15, 2011 4:34 PM
  • You can adjust the CommondTimeOut value according to the amount of data you want to deprovision to handle the timeout issues during directly deprovisioning.

     

    As previous post mentioned, there is a bug in the code to generate scripts for deprovision where the CommandTimeout value isn’t used.

     

    To workaround this, you could consider split the tables into smaller sync groups.  Or you could make a copy of your database, drop objects which are not needed for sync in this copy , then generate the scripts against this copy of database. The objects Sync needs include tables and PK constraint.  


    Ann Tang
    Thursday, April 21, 2011 8:14 PM
  • Thank you all for your inputs.

    As we are towards the end of our development cycle, it would be a bit tricky to refactor the DB. We are trying to use SqlSyncScopeDeprovisioning.ScriptDeprovisionStore() method to generate the script by retrieving the necessary sections.

    Monday, May 2, 2011 9:28 PM