diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-06-18 16:42:20 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-06-18 16:42:20 +0100 |
| commit | c5089d25cb60d7c4b819c4eab3cdbf2090ef192c (patch) | |
| tree | d1085c404d314c791d10d0687b82f0c237556839 | |
| parent | 4df0bedd7694ee7638b6bc7d07c2eb34307c79b0 (diff) | |
| download | wiki-c5089d25cb60d7c4b819c4eab3cdbf2090ef192c.tar.gz wiki-c5089d25cb60d7c4b819c4eab3cdbf2090ef192c.tar.bz2 wiki-c5089d25cb60d7c4b819c4eab3cdbf2090ef192c.zip | |
Intermittent "page not found" traced to open Firebird transaction when
an exception escapes store() before CompleteTrans() runs. Includes
diagnostic query and proposed fix pattern.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rw-r--r-- | CLAUDE.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..97b1393 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,36 @@ +# Wiki Package — Developer Notes + +## BitPage::store() — missing RollbackTrans +`BitPage::store()` (line 220) wraps the entire save in `StartTrans()` / `CompleteTrans()` +but has no `RollbackTrans()` fallback. If an exception escapes — e.g. from the nested +`LibertyMime::store()` call at line 222, which has its own `StartTrans()` — `CompleteTrans()` +never runs and Firebird is left with an open transaction holding locks on `wiki_pages` +and/or `liberty_content` rows. + +Symptom: wiki pages return "page not found" until Firebird is restarted. The failed save +appears to cause no visible error, but the stuck transaction blocks subsequent access to +the affected rows. + +**Diagnostic** — run in isql when stuck: +```sql +SELECT t.MON$TRANSACTION_ID, t.MON$TIMESTAMP, + s.MON$SQL_TEXT, s.MON$STATE +FROM MON$TRANSACTIONS t +LEFT JOIN MON$STATEMENTS s ON s.MON$TRANSACTION_ID = t.MON$TRANSACTION_ID +WHERE t.MON$STATE = 1; +``` + +**Fix** — wrap the body of `store()` in a try/catch with `RollbackTrans()`: +```php +$this->StartTrans(); +try { + // ... existing body ... + $this->CompleteTrans(); +} catch( \Exception $e ) { + $this->mDb->RollbackTrans(); + $this->mErrors['store'] = $e->getMessage(); +} +``` + +Do not action until confirmed via `MON$TRANSACTIONS` — use xdebug or the monitoring +query above to verify this is the actual call stack before patching. |
