Показать сообщение отдельно
Старый 23.04.2008, 23:06   #1  
Blog bot is offline
Blog bot
Участник
 
25,491 / 846 (79) +++++++
Регистрация: 28.10.2006
gatesasbait: Table caching and record delete()/update()/next
Источник: http://gatesasbait.spaces.live.com/B...B9F5!209.entry
==============

 
Good morning,
 
This is a very basic concept. If you get the following error:
"Cannot call NEXT, update(), or delete() on buffer where data is selected or inserted in another transactionscope."
 
It means that the record selected has table caching activated, such as 'NotInTTS' and that you attempted to, for example run code like the following:
 
//wrong
select firstonly forupdate aRecord;
ttsbegin;
aRecord.delete();
ttscommit;
 
It is important in general and necessary for cached tables to begin the transaction scope before selecting the record for update. And so, even for tables that do not have caching enabled, it is strongly discouraged to call NEXT, update(), or delete() on a buffer outside of the transaction scope it was selected in.
 
//good
ttsbegin;
select firstonly forupdate aRecord;

aRecord.delete();
ttscommit;



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