Таблицы без столбца фильтра не синхронизируются в фреймворке синхронизации Microsoft

Вопрос о структуре синхронизации Microsoft

У меня есть некоторые таблицы в моей области синхронизации, некоторые из которых имеют фильтр " UserId", а 4 таблицы не имеют фильтров.

Из таблиц "без фильтров" одна работает нормально и синхронизируется, но 3 из вновь добавленных таблиц не синхронизируются

ниже мой конфигурационный файл

Таблицы ContactStatus, ContactAction, ContactActionRule без фильтров не синхронизируются, хотя я не получаю никакой ошибки.

Но в то же время таблица настроек, которая также не имеет фильтров, синхронизируется. Я знаю, что это будет трудно отлаживать, но если у кого-то из вас есть какие-либо идеи, пожалуйста, скажите мне.

Вот так я попал в сервис

HTTPS:AnzuReaderSyncSyncService.svc/ARSync/DownloadChanges fk_user_id=1902

 <SyncConfiguration>
        <SyncScopes>
          <SyncScope Name="ARSync" SchemaName="dbo" IsTemplateScope="true" EnableBulkApplyProcedures="true">
            <SyncTables>
              <SyncTable Name="[ContactStatus]" GlobalName="ContactStatus" SchemaName="" IncludeAllColumns="true" FilterClause="">
                <SyncColumns>
                  <SyncColumn Name="Id" GlobalName="Id" SqlType="int" IsPrimaryKey="true" IsNullable="false" />
                  <SyncColumn Name="StatusName" GlobalName="StatusName" SqlType="varchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateAdded" GlobalName="DateAdded" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateUpdated" GlobalName="DateUpdated" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="LastUpdatedBy" GlobalName="LastUpdatedBy" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DeleteMark" GlobalName="DeleteMark" SqlType="bit" IsPrimaryKey="false" IsNullable="true" />
                </SyncColumns>
              </SyncTable>
              <SyncTable Name="[ContactAction]" GlobalName="ContactAction" SchemaName="" IncludeAllColumns="true" FilterClause="">
                <SyncColumns>
                  <SyncColumn Name="Id" GlobalName="Id" SqlType="int" IsPrimaryKey="true" IsNullable="false" />
                  <SyncColumn Name="Action" GlobalName="Action" SqlType="varchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateAdded" GlobalName="DateAdded" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateUpdated" GlobalName="DateUpdated" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="LastUpdatedBy" GlobalName="LastUpdatedBy" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                </SyncColumns>
              </SyncTable>
              <SyncTable Name="[ContactActionRule]" GlobalName="ContactActionRule" SchemaName="" IncludeAllColumns="true" FilterClause="">
                <SyncColumns>
                  <SyncColumn Name="Id" GlobalName="Id" SqlType="int" IsPrimaryKey="true" IsNullable="false" />
                  <SyncColumn Name="FK_ContactAction_Id" GlobalName="FK_ContactAction_Id" SqlType="int" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="FK_OriginalState_Id" GlobalName="FK_OriginalState_Id" SqlType="int" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="FK_SenderState_Id" GlobalName="FK_SenderState_Id" SqlType="int" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="FK_ContactState_Id" GlobalName="FK_ContactState_Id" SqlType="int" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="DateAdded" GlobalName="DateAdded" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateUpdated" GlobalName="DateUpdated" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="LastUpdatedBy" GlobalName="LastUpdatedBy" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                </SyncColumns>
              </SyncTable>
              <SyncTable Name="[UserLibrary]" GlobalName="UserLibrary" SchemaName="" IncludeAllColumns="true" FilterClause="[side].FK_User_Id = @FK_User_Id">
                <SyncColumns>
                  <SyncColumn Name="Id" GlobalName="Id" SqlType="uniqueidentifier" IsPrimaryKey="true" IsNullable="false" />
                  <SyncColumn Name="Name" GlobalName="Name" SqlType="varchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="Description" GlobalName="Description" SqlType="nvarchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="FK_User_Id" GlobalName="FK_User_Id" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="ParentId" GlobalName="ParentId" SqlType="uniqueidentifier" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="SequenceNo" GlobalName="SequenceNo" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="IsRecycled" GlobalName="IsRecycled" SqlType="bit" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateAdded" GlobalName="DateAdded" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="LastUpdatedBy" GlobalName="LastUpdatedBy" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateUpdated" GlobalName="DateUpdated" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                </SyncColumns>
                <FilterColumns>
                  <FilterColumn Name="FK_User_Id" />
                </FilterColumns>
                <FilterParameters>
                  <FilterParameter Name="@FK_User_Id" SqlType="int" DataSize="0" />
                </FilterParameters>
              </SyncTable>

              <SyncTable Name="[Discussion]" GlobalName="Discussion" SchemaName="" IncludeAllColumns="true" FilterClause="[side].FK_User_Id = @FK_User_Id">
                <SyncColumns>
                  <SyncColumn Name="Id" GlobalName="Id" SqlType="int" IsPrimaryKey="true" IsNullable="false" />
                  <SyncColumn Name="ParentId" GlobalName="ParentId" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="FK_User_Id" GlobalName="FK_User_Id" SqlType="int" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="FK_Application_Id" GlobalName="FK_Application_Id" SqlType="int" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="Title" GlobalName="Title" SqlType="varchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="Description" GlobalName="Description" SqlType="nvarchar" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="Tag" GlobalName="Tag" SqlType="varchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="FK_DomainLibrary_Id" GlobalName="FK_DomainLibrary_Id" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="FK_Publication_Id" GlobalName="FK_Publication_Id" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="FK_ContentType_Id" GlobalName="FK_ContentType_Id" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="FK_Category_Id" GlobalName="FK_Category_Id" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="FK_SubCategory_Id" GlobalName="FK_SubCategory_Id" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="PageNumber" GlobalName="PageNumber" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="Text" GlobalName="Text" SqlType="nvarchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="TimeFrame" GlobalName="TimeFrame" SqlType="float" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="PositionMatrix" GlobalName="PositionMatrix" SqlType="text" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="ChapterNumber" GlobalName="ChapterNumber" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DeleteMark" GlobalName="DeleteMark" SqlType="bit" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateAdded" GlobalName="DateAdded" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateUpdated" GlobalName="DateUpdated" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="LastUpdatedBy" GlobalName="LastUpdatedBy" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="PubDBContentId" GlobalName="PubDBContentId" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="Url" GlobalName="Url" SqlType="varchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="ChildCount" GlobalName="ChildCount" SqlType="int" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="RootId" GlobalName="RootId" SqlType="int" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="FK_Content_Id" GlobalName="FK_Content_Id" SqlType="uniqueidentifier" IsPrimaryKey="false" IsNullable="true" />
                </SyncColumns>
                <FilterColumns>
                  <FilterColumn Name="FK_User_Id" />
                </FilterColumns>
                <FilterParameters>
                  <FilterParameter Name="@FK_User_Id" SqlType="int" DataSize="0" />
                </FilterParameters>
              </SyncTable>

              <SyncTable Name="[Settings]" GlobalName="Settings" SchemaName="" IncludeAllColumns="true" FilterClause="">
                <SyncColumns>
                  <SyncColumn Name="Id" GlobalName="Id" SqlType="int" IsPrimaryKey="true" IsNullable="false" />
                  <SyncColumn Name="Key" GlobalName="Key" SqlType="varchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="Title" GlobalName="Title" SqlType="nchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DefaultValue" GlobalName="DefaultValue" SqlType="varchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="Description" GlobalName="Description" SqlType="varchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="Type" GlobalName="Type" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateAdded" GlobalName="DateAdded" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateUpdated" GlobalName="DateUpdated" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                </SyncColumns>
              </SyncTable>

              <SyncTable Name="[UserContact]" GlobalName="UserContact" SchemaName="" IncludeAllColumns="true" FilterClause="[side].SenderId = @FK_User_Id">
                <SyncColumns>
                  <SyncColumn Name="Id" GlobalName="Id" SqlType="int" IsPrimaryKey="true" IsNullable="false" />
                  <SyncColumn Name="SenderId" GlobalName="SenderId" SqlType="int" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="ContactId" GlobalName="ContactId" SqlType="int" IsPrimaryKey="false" IsNullable="false" />
                  <SyncColumn Name="FK_ContactStatus_Id" GlobalName="FK_ContactStatus_Id" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="ContactName" GlobalName="ContactName" SqlType="varchar" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="Follows" GlobalName="Follows" SqlType="bit" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateAdded" GlobalName="DateAdded" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="DateUpdated" GlobalName="DateUpdated" SqlType="datetime" IsPrimaryKey="false" IsNullable="true" />
                  <SyncColumn Name="LastUpdatedBy" GlobalName="LastUpdatedBy" SqlType="int" IsPrimaryKey="false" IsNullable="true" />
                </SyncColumns>
                <FilterColumns>
                  <FilterColumn Name="SenderId" />
                </FilterColumns>
                <FilterParameters>
                  <FilterParameter Name="@FK_User_Id" SqlType="int" DataSize="0" />
                </FilterParameters>
              </SyncTable> 
          </SyncScope>
        </SyncScopes>
        <Databases>
          <TargetDatabase Name="ARSyncDB" DbServer="50.56.173.145" DbName="ARDevDB2.0Sync" UserName="sabeta" Password="sa123$" UseIntegratedAuth="false" />
        </Databases>
      </SyncConfiguration>

1 ответ

Включите синхронизацию трассировки FX или SQL Server Profiler, чтобы увидеть, что происходит под капотом. Вы также можете проверить наличие конфликтов или ограничений (особенно FK), которые могут препятствовать применению изменений.

Другие вопросы по тегам