View Issue Details

IDProjectCategoryView StatusLast Update
0005493CaseTalk ModelerOtherpublic2026-03-30 21:55
ReporterMarco Wobben Assigned ToMarco Wobben  
PriorityhighSeveritycrashReproducibilityhave not tried
Status resolvedResolutionfixed 
Target Version15.0Fixed in Version15.0 
Summary0005493: Application freezes: SQLite deadlock in NamespacesDmd.SaveTmrTimer
Description

Application frozen. Main thread blocked in RtlEnterCriticalSection inside TSQLiteStatement.ExecuteBase — waiting for a SQLite critical section that is held by another thread. The deadlock occurs during a timer-driven namespace save (NamespacesDmd.SaveTmrTimer).

Call chain:
RtlEnterCriticalSection (ntdll)
TSQLiteStatement.ExecuteBase (FireDAC.Phys.SQLiteWrapper:4663)
TFDPhysSQLiteCommand.InternalOpen (FireDAC.Phys.SQLite:2863)
... FireDAC open chain ...
TFDPhysSQLiteCommand.InternalColInfoStart (FireDAC.Phys.SQLite:2477)
TFDDataSet.SetActive / .Open
TNamespacesDmd.Save (NamespacesDmdUnit:196)
TNamespacesDmd.SaveTmrTimer (NamespacesDmdUnit:232)
TTimer.Timer

Likely cause: the SaveTmrTimer fires while another thread holds the SQLite connection lock (e.g. FastLoad or InternalSchema query running concurrently).

TagsNo tags attached.
CaseTalk EditionCorporate

Activities

Marco Wobben

Marco Wobben

2026-03-30 17:37

administrator   ~0005927

Fixed in DbDmdUnit.pas: FastLoadScriptCallback called GenerateFTS and ApplyPersistentScript directly on the FastLoad worker thread. Both use DbDmd.Conn (settings.sdb), whose FireDAC connection-level critical section is not thread-safe. This created a classic lock+Synchronize deadlock: (1) FastLoad worker holds DbDmd.Conn CS (executing a statement), (2) main thread blocks in NamespacesQry.Open waiting for that same CS, (3) FastLoad worker then calls RadioStationEtc.EndUpdate(NRL_SQLBUSY) which uses TThread.Synchronize — waits for main thread — deadlock. Fix: wrapped both GenerateFTS and ApplyPersistentScript in TThread.Synchronize so they always execute on the main thread. TThread.Synchronize is a no-op when already on main thread, so this is safe regardless of caller context.

Issue History

Date Modified Username Field Change
2026-03-30 17:16 Marco Wobben New Issue
2026-03-30 17:16 Marco Wobben View Status public => private
2026-03-30 17:17 Marco Wobben Target Version => 15.0
2026-03-30 17:17 Marco Wobben View Status private => public
2026-03-30 17:17 Marco Wobben Summary Application freezes: SQLite deadlock in NamespacesDmd.SaveTmrTimer (ProRail) => Application freezes: SQLite deadlock in NamespacesDmd.SaveTmrTimer
2026-03-30 17:17 Marco Wobben Description Updated
2026-03-30 17:36 Marco Wobben Assigned To => Marco Wobben
2026-03-30 17:36 Marco Wobben Status new => resolved
2026-03-30 17:36 Marco Wobben Resolution open => fixed
2026-03-30 17:36 Marco Wobben Fixed in Version => 15.0
2026-03-30 17:37 Marco Wobben Note Added: 0005927