mcpField
P
protheus-locks-deadlocks

protheus-locks-deadlocks

github.com/thalysjuvenalData & databases19147 installsUpdated 6w ago
Repository

About protheus-locks-deadlocks

A reference skill for developers diagnosing and preventing locking problems in Protheus. It explains the hybrid record-locking model, transaction-scoping practices, and live diagnostics for supported database engines.

Key features

  1. 01Protheus locking model and API semantics
  2. 02Safe transaction scoping patterns
  3. 03Lock ordering and contention prevention
  4. 04Live lock and deadlock diagnostics
  5. 05Database-engine-specific SQL checks

Use cases

  1. 01Investigating a record-locked error
  2. 02Diagnosing contention under concurrent load
  3. 03Reviewing code that locks records
  4. 04Planning batch jobs with lock ordering

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/thalysjuvenal/advpl-specialist --skill protheus-locks-deadlocks

After installing, type/protheus-locks-deadlocksin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

diagnostics.md
patterns-prevention.md
reference.md

Details

From the project README

Protheus Locks & Deadlocks

This skill documents the Protheus hybrid locking model -- record-level Workarea locks (RecLock/MsUnlock) coordinated by DBAccess on top of the underlying RDBMS (PostgreSQL, MSSQL, Oracle) -- and how to diagnose and prevent the lock leaks, contention, and deadlocks that are among the most common production issues. It covers lock API semantics (RecLock, MsUnlock/MsUnlockAll, SoftLock, LockByName, TCSqlExec, BeginTran/EndTran/DisarmTransaction), safe transaction scoping with BEGIN SEQUENCE/RECOVER, and live diagnostic procedures per database engine.

Activate this skill when the user reports a "Record locked by user XYZ" error, needs to investigate performance degradation under concurrent load, is writing or reviewing code that locks records, or is designing a batch job over large data sets where lock ordering matters. It does not cover query design or %nolock% usage in Embedded SQL (see query-builder), general runtime/performance debugging unrelated to locking (see advpl-debugging), or BeginSQL/EndSQL macro syntax (see embedded-sql).

Reference fileRead when
reference.mdAlways -- lock types table, core lock/transaction APIs, when-to-use guidance
patterns-prevention.mdWriting or refactoring code that locks records -- BEGIN SEQUENCE/RECOVER, SoftLock, transaction scoping, lock ordering rules
diagnostics.mdInvestigating live lock contention or deadlocks -- TopMemoStatus, MonitorActiveLocks, DBAccess monitor, engine-specific SQL lock queries

Comments

Markdown supported