transactions-locks

Writes and reviews 1C:Enterprise transactions, managed locks, and responsible reads.

1|2|Updated Jul 19, 2026
One-click install
npx skills add https://github.com/IngvarConsulting/unica-marketplace --skill transactions-locks-ingvarconsulting
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: transactions-locks
Source: https://github.com/IngvarConsulting/unica-marketplace/tree/main/plugins/unica/skills/transactions-locks
Command: npx skills add https://github.com/IngvarConsulting/unica-marketplace --skill transactions-locks-ingvarconsulting

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? 1C:Enterprise code often loses updates, deadlocks, or leaves transactions unpaired because reads that drive writes are not locked, exceptions are mistaken for rollbacks, and lock order is never stated. This Skill gives a concrete model and workflow for building correct transactions with managed locks and responsible reading. ## Core Features & Use Cases - Transaction shape enforcement: Ensures every НачатьТранзакцию has paired commit and rollback in the same method, with the correct Попытка/Исключение structure per standards АПК:325-332 and BSLLS:PairingBrokenTransaction. - Managed lock design: Classifies reads as responsible, names contended resources, sets exclusive or shared locks before reads, and keeps one lock order to prevent deadlocks. - Deadlock and lock-wait diagnosis: Builds a timeline from runtime evidence and identifies the contended resource before proposing changes, instead of blind retries or widened lock ranges. - Use Case: A posting handler throws "В этой транзакции уже происходили ошибки" under load. Use this Skill to locate the broken transaction boundaries with unica.code.outline, fix the exception block to call ОтменитьТранзакцию first, and verify with unica.code.diagnostics. ## Quick Start Ask the assistant to review a 1C module for transaction and locking correctness, for example: review this document posting procedure for responsible reads, managed locks, and deadlock risk.

Frequently Asked Questions about transactions-locks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a correct transaction in 1C:Enterprise?▼

Begin the transaction, then put the managed lock, the read, the write, and the commit inside the Попытка block, and start the Исключение block with ОтменитьТранзакцию. Begin and finish the transaction in the same method, with no executable code between НачатьТранзакцию and Попытка.

How do I diagnose a deadlock or lock wait in 1C?▼

Build a timeline from runtime evidence and identify the contended resource, which is the indivisible set of data two sessions capture. State the lock order across all resources before changing anything; do not add retries or widen lock ranges before the resource is named.

Does an exception roll back a 1C transaction automatically?▼

No. An exception only raises the internal no-successful-completion flag; the rollback happens when execution reaches ЗафиксироватьТранзакцию or ОтменитьТранзакцию. This is why every НачатьТранзакцию needs both paired calls and ОтменитьТранзакцию first in the exception block.

When should I lock a read before writing in 1C?▼

Lock before the read whenever the read is responsible, meaning its result changes data or drives a decision that leads to changes. Without a lock held across the read-decide-write sequence, two sessions read the same value and one write is lost.

Can I use ДЛЯ ИЗМЕНЕНИЯ with managed lock mode in 1C?▼

No. ДЛЯ ИЗМЕНЕНИЯ belongs to the automatic lock mode and is flagged by diagnostic АПК:66. Configurations running in the Управляемый lock mode must use explicit managed locks via БлокировкаДанных with Заблокировать called inside the Попытка block.