/protheus-locks-deadlocks
Use when the user needs to understand, diagnose, or prevent Protheus record locks and deadlocks -- covering RecLock/MsUnlock/SoftLock/LockByName semantics, BeginTran/EndTran transaction scoping, lock leak and deadlock diagnostics (TopMemoStatus, MonitorActiveLocks, DBAccess
$ npx -y skills add thalysjuvenal/advpl-specialist --skill protheus-locks-deadlocks --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/protheus-locks-deadlocks
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use when the user needs to understand, diagnose, or prevent Protheus record locks and deadlocks -- covering RecLock/MsUnlock/SoftLock/LockByName semantics, BeginTran/EndTran transaction scoping, lock leak and deadlock diagnostics (TopMemoStatus, MonitorActiveLocks, DBAccess
SKILL.md
protheus-locks-deadlocks.SKILL.mdname: protheus-locks-deadlocks
description: Use when the user needs to understand, diagnose, or prevent Protheus record locks and deadlocks -- covering RecLock/MsUnlock/SoftLock/LockByName semantics, BeginTran/EndTran transaction scoping, lock leak and deadlock diagnostics (TopMemoStatus, MonitorActiveLocks, DBAccess monitor, SQL Server/PostgreSQL/Oracle lock queries), and prevention patterns (BEGIN SEQUENCE/RECOVER, lock ordering). Also triggers on Portuguese phrasing like "registro travado", "trava de registro", "deadlock", "erro de lock", "travamento no Protheus", "quem esta travando o registro", or "RecLock nao libera".
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 file | Read when | |---|---| | reference.md | Always -- lock types table, core lock/transaction APIs, when-to-use guidance | | patterns-prevention.md | Writing or refactoring code that locks records -- `BEGIN SEQUENCE/RECOVER`, `SoftLock`, transaction scoping, lock ordering rules | | diagnostics.md | Investigating live lock contention or deadlocks -- `TopMemoStatus`, MonitorActiveLocks, DBAccess monitor, engine-specific SQL lock queries |
Read more
name: protheus-locks-deadlocks description: Use when the user needs to understand, diagnose, or prevent Protheus record locks and deadlocks -- covering RecLock/MsUnlock/SoftLock/LockByName semantics, BeginTran/EndTran transaction scoping, lock leak and deadlock diagnostics (TopMemoStatus, MonitorActiveLocks, DBAccess monitor, SQL Server/PostgreSQL/Oracle lock queries), and prevention patterns (BEGIN SEQUENCE/RECOVER, lock ordering). Also triggers on Portuguese phrasing like "registro travado", "trava de registro", "deadlock", "erro de lock", "travamento no Protheus", "quem esta travando o registro", or "RecLock nao libera".
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 file | Read when | |---|---| | reference.md | Always -- lock types table, core lock/transaction APIs, when-to-use guidance | | patterns-prevention.md | Writing or refactoring code that locks records -- `BEGIN SEQUENCE/RECOVER`, `SoftLock`, transaction scoping, lock ordering rules | | diagnostics.md | Investigating live lock contention or deadlocks -- `TopMemoStatus`, MonitorActiveLocks, DBAccess monitor, engine-specific SQL lock queries |
Plugin para Claude Code especializado em ADVPL e TLPP para desenvolvimento no ecossistema TOTVS Protheus — para desenvolvedores e consultores funcionais. Documentacao completa:
Other skills on advpl-specialist.
- /advpl-code-generation
Use when the user asks to generate, create, or scaffold ADVPL/TLPP code for TOTVS Protheus -- User Functions, Static Functions, TLPP classes, MVC (Model/View/Controller), REST APIs, SOAP web services, entry points (pontos de entrada), TReport/FWMsPrinter reports, jobs, or
Open skill - /advpl-code-review
Use when the user asks to review, audit, or check the quality of ADVPL/TLPP code for TOTVS Protheus before merge or deploy -- covering best practices (RecLock/MsUnlock pairing, variable scope, area management, error handling), performance bottlenecks, security vulnerabilities
Open skill - /advpl-debugging
Use when the user asks to debug, diagnose, or fix an ADVPL/TLPP error on TOTVS Protheus -- compilation errors (syntax, missing includes, undeclared variables), runtime failures (NIL access, type mismatch, array bounds), performance issues (slow queries, memory leaks), database
Open skill - /advpl-refactoring
Use when the user asks to refactor, clean up, or restructure existing ADVPL/TLPP code on TOTVS Protheus without changing its behavior -- extracting long functions (>100 lines), simplifying deeply nested conditionals, removing dead code, improving variable naming (Hungarian
Open skill - /advpl-to-tlpp-migration
Use when the user asks to migrate, convert, compatibilize, or modernize legacy ADVPL procedural code to TLPP object-oriented classes on TOTVS Protheus -- turning User Functions/Static Functions into namespaced classes with methods and data properties, replacing Private/Public
Open skill - /advpr-test-automation
Use when the user wants to write, run, or troubleshoot automated regression tests for Protheus routines with ADVPR (Advanced Protheus Robot) -- covering FWTestHelper API, TestSuite/GPS de Testes setup, headless execution via FwExecSuite, and per-pattern scripting (MVC,
Open skill

