/advpl-specialist:protheus-locks-deadlocksfrom advpl-specialist
Diagnoses and prevents Protheus record locks and deadlocks. Covers RecLock/MsUnlock semantics, transaction scoping, lock leaks, and live diagnostics per database engine.
Ships in advpl-specialist. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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 database-specific locking hints in 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 |
What SKILL.md sets; muted values are Claude Code's defaults
19 skills in this plugin
/advpl-code-generationGenerate or scaffold ADVPL/TLPP code - User Functions, TLPP classes, MVC, REST, SOAP, entry points, reports, jobs. "gerar codigo", "criar rotina", "novo ponto de entrada", "criar classe tlpp", "gerar api rest"./advpl-code-reviewReview or audit ADVPL/TLPP code for best practices, performance, security and SonarQube rules (CA/BG/CS). "revisar codigo", "auditar rotina", "checar boas praticas", "code review advpl"./advpl-debuggingDebug ADVPL/TLPP errors - compilation, runtime (NIL, type mismatch), slow queries, locks, AppServer logs and stack traces. "erro de compilacao", "travou o lock", "performance lenta", "analisar log"./advpl-refactoringRefactor or clean up ADVPL/TLPP without changing behavior - extract functions, simplify conditionals, remove dead code. "refatorar rotina", "extrair funcao", "remover codigo morto", "God function"./advpl-to-tlpp-migrationMigrate or modernize procedural ADVPL (.prw) to TLPP classes with namespaces, keeping compatible wrappers. "migrar para tlpp", "converter prw para tlpp", "compatibilizar fonte", "transformar em classe"./advpr-test-automationWrite, run or troubleshoot ADVPR (Advanced Protheus Robot) automated tests - FWTestHelper, TestSuite, FwExecSuite. "teste automatizado", "robo de testes", "GPS de testes", "rodar suite de testes".npx claudepluginhub thalysjuvenal/advpl-specialist --plugin advpl-specialistOther plugins' skills for the same job