Метод serialized
Сигнатура метода
private function serialized(DictionaryType $type, string $id, callable $write): Result
Возвращает:
Result
Описание
$write with the writes of the value $id of the dictionary $type held to one at a time. Every write of this boundary reads storage before it changes it - the facade asks whether the identifier is free before it inserts ({@see \CCrmStatus::CheckStatusId()}), and a change and an erasure read the row they address before they touch it - and the storage makes none of those reads hold: the index over the pair (dictionary, identifier) is not a unique one. Two writes interleaving between the read and the statement therefore store two rows under one published identifier, or leave a change writing over a row an erasure has already taken. A transaction on its own would not help: with no constraint to break there is nothing for it to refuse, and the row another writer inserts is not a row an isolation level of the storage hides. The lock is the pair and not the dictionary or the table, so callers configuring different values never wait for each other. It holds the writers of this boundary and nobody else: everything else of the portal writing the same table - the administrative interface of the dictionaries above all - takes no lock and is not held back by this one, so the reads above are serialized rather than guaranteed.
Параметры
3| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$type
|
DictionaryType
|
—
|
—
|
$id
|
string
|
—
|
—
|
$write
|
callable
|
—
|
—
|
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulescrm/lib/V2/Internal/Repository/Dictionary/DictionaryValueRepository.php