AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 29.11.2007, 00:53   #1  
Blog bot is offline
Blog bot
Участник
 
25,631 / 848 (80) +++++++
Регистрация: 28.10.2006
gatesasbait: On data dictionary synchronization errors
Источник: http://gatesasbait.spaces.live.com/B...B9F5!141.entry
==============

 
Good afternoon,
 
Today, I'll describe some of the more common causes of Data Dictionary Synchronization failures, how to diagnose them and how to fix them. Most of this post should be applicable from Ax 2.5 all the way up to DAX 5.0.
 
Dictionary overview
 
Every object related to the SQL Database (tables, table fields, table indexes) is identified by 'name' in the Database, but identified by a 'unique id' in Dynamics Ax. This unique id is kept in code, in its respective layer file (*.aod). This unique id is a constant; SalesTable for example has had the table id '366' since forever. The object id found in the layer is matched with the Database object name through a table called 'SQLDictionary'. This table maps DAX table ids to SQL table names, and DAX field ids to SQL field names. This means that in theory and practice, a field could have a certain name under DAX, and a different name under the SQL Databse; this happens for example when the object name under the DAX AOT is longer than 30 characters.
 
During synchronization of the dictionnary under the DAX AOT, DAX looks through the SQLDictionary table and verifies that all tables and fields can be found, that they have the proper id and that the corresponding SQL object exists with the proper name and proper type.
 
Possible scenarios at synchronization 
  1. An object (table or field) exists on the SQL Database, exists on a DAX layer and is properly mapped in the SQLDictionary table: DAX is properly aware of this object and nothing will occur at synchronization.
  2. An object (table or field) exists on the SQL Database, but not on any DAX layer nor in the SQLDictionary table: DAX is not aware of this object and nothing will occur at synchronization.
  3. An object (table or field) exists in the AOT and cannot be found in the SQLDictionary table: DAX will attempt to create the object in the SQL Database and insert a corresponding cross-reference record in SQLDictionary. Since DAX is not aware of the Database contents beyond the information contained in SQLDictionary a synchronization error will occur if an object of the same name already exists in the Database.

  4. An object (table or field) exists in the AOT, can be found in the SQLDictionary table, but doesn't exist in the SQL Database: DAX will attempt to create the object in the SQL Database and update the corresponding cross-reference record in SQLDictionary.

  5. A field exists in the AOT (suppose an Int64) and can be found in the SQLDictionary table (as an Int) as well as in the Database: A synchronization error will occur.


  6. An object (table or field) exists in the AOT, can be found in the SQLDictionary table but with a different id, as well as in the Database (happens when a object was moved between layers and restoring a prior database): DAX wil attempt to recreate the object in the Database and will fail with a synchronization error. The original may be dropped.





    An index exists in the AOT, but not in the SQL Database: DAX will attempt to introduce this new index to the table in the database. If the index is unique and records are seen as duplicates against it, a synchronization error will occur.





Diagnosing synchronization errors
 
Sometimes, DAX will fail to synchronize a table and give you an error message that does not identify the problematic table. This job will help you determine where the cause of the error is:
 
static void manualSync(Args _args)
{
    #define.unknown("UNKNOWN")
    #define.tableIdMax(65536)
    int i = 1;
    ;
    while (i < #tableIdMax)
    {
        if (tableid2name(i) != #unknown)
        {
            print(tableid2name(i));
            try
            {
                if (!appl.dbSynchronize(i, false, true))
                    throw Exception::Error;
            }
            catch
            {
                error(tableid2name(i));
            }
        }
        i++;
    }
}
 
more to come (such as code examples to fix SQLDictionary) ...







Источник: http://gatesasbait.spaces.live.com/B...B9F5!141.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Solutions Monkey: Programatically reading data from AxDataSourceControl Blog bot DAX Blogs 1 07.11.2008 09:17
axStart: Change data on a data source on a Form Blog bot DAX Blogs 0 04.09.2008 15:05
Dynamics AX: Dynamics AX 2009 - Demo Data Released Blog bot DAX Blogs 1 11.07.2008 11:24
axStart: Synchronizing dictionary gives unclear errors Blog bot DAX Blogs 0 15.12.2007 01:11
Как сделать SQL-таблицу видимой в Data Dictionary ? Zabr DAX: Программирование 10 22.08.2007 17:30

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 21:14.