Oracle - template and bulk procedures + GetScopeDescription map problems RRS feed

  • Question

  • Problem 1.

    I work on Oracle 11g and MSSQL2008 Sync Project and I found problem with BulkInserts in this topic :


    I tried to add some data filtering based on templates on MSSQL side:

    SqlSyncScopeProvisioning serverTemplate = new SqlSyncScopeProvisioning(msConn, scopeDesc, SqlSyncScopeProvisioningType.Template);

    After sync I got error mentioned in topic above (Caught exception while applying changes: System.InvalidCastException: Specified cast is not valid.)

    So I tried to disable BulkProcedures again. But I got another problem during sync:

    "Microsoft.Synchronization.Data.DbProvisioningException: Cannot alter UseBulkProcedures when a scope is being created from a template"

    The only solution is to build adapters manually (I have never tried it yet)?
    Or I could add filters in another way without using templates?

    Problem 2.

    In another example I tried to do was Provision MSSQL on Oracle base using :

    DbSyncScopeDescription scopeDesc = ((OracleDbSyncProvider)ceSharingForm.providersCollection["Server Oracle"]).GetScopeDescription();

    And I have discovered that :

     scopeDesc.Tables[i].Columns[j].Type = ((OracleType)Int32.Parse(scopeDesc.Tables[i].Columns[j].Type)).ToString().ToLower();

    Maps float on int

    To be specyfic, this returns 13 - which is Type of int :


    This means destination table and procedures use integer instead of float.

    Problem 2 can be ignored since I can create MSSQL base myself. But Problem 1 is critical for me.
    Thanks for help in advance

    • Edited by TPiec Wednesday, March 28, 2012 10:58 AM
    Wednesday, March 28, 2012 10:54 AM


  • Problem 1 Solved ;)

    I was using provision template becasue of used parameter but I can filter columns without parameter. I mean I used FilterClause with hard coded param.

    To solve it I used:

    SqlSyncScopeProvisioning serverTemplate = new SqlSyncScopeProvisioning(ceConn, scopeDesc);

    instead of:

    SqlSyncScopeProvisioning serverTemplate = new SqlSyncScopeProvisioning(ceConn, scopeDesc, SqlSyncScopeProvisioningType.Template);

    and removed :

    serverProvRetail.PopulateFromTemplate(scopeName, "template_filter");

    and removed ofcourse params from serverTemplate.Tables["orders"].FilterClause = "[side].id=@p_id" and removed below:

    SqlParameter param = new SqlParameter("@p_id", SqlDbType.SmallInt);

    This might be obvious for many of you, but not for me ;) and maybe this will help someone.

    Ofc JuneT site helped http://jtabadero.wordpress.com/2010/09/02/sync-framework-provisioning/

    • Edited by TPiec Wednesday, March 28, 2012 1:17 PM
    • Proposed as answer by JuneT Thursday, April 5, 2012 10:32 AM
    • Marked as answer by TPiec Thursday, April 5, 2012 10:53 AM
    Wednesday, March 28, 2012 1:11 PM