Показать сообщение отдельно
Старый 08.08.2009, 10:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
gatesasbait: Logging independently of transaction scope by using a separate thread in Dynamics AX (deux)
Источник: http://gatesasbait.spaces.live.com/B...B9F5!498.entry
==============

 
Good evening
 
Michal Kupczyk from this thread on the Microsoft communities proposes a much better way to log independantly of transaction scope in Dynamics Ax than what I had originally proposed here. Instead of using a separate thread to log, is uses a UserConnection object.
 
In addition to being simpler, it also has the added value of working from within batches. Batches it seems don't support multithreading.
 
void method()
{
    UserConnection conn = new UserConnection();

    yourLogTable = null;
    yourLogTable.setConnection(conn);

    ttsbegin;


    [...]

    yourLogTable.Log = 'This is tts-independent log';
    yourLogTable.insert();

    if (some_error)
    {
        throw Error('Error in processing');
    }

    ttscommit;
}



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