Commit 87c2176
committed
parallel enhancements
Here's a summary of every change made:
New files
File Purpose
src/SqliteErrorCodes.cs Internal constants and classifiers for SQLITE_BUSY, SQLITE_BUSY_SNAPSHOT (517), SQLITE_BUSY_RECOVERY, SQLITE_LOCKED, etc.
src/Models/SqliteSynchronousMode.cs Enum for PRAGMA synchronous (Off/Normal/Full/Extra) with full durability trade-off documentation
src/Models/WalCheckpointStatus.cs Record returned by GetWalCheckpointStatusAsync — exposes busy flag, total frames, checkpointed frames, and progress %
Modified files
SqliteConcurrencyOptions.cs
Added SynchronousMode (default Normal), UpgradeTransactionsToImmediate (default true), LoggerFactory (excluded from equality)
Added Validate() with bounds checks on all numeric properties
Updated Equals/GetHashCode to include new behavior-affecting properties
SqliteConcurrencyInterceptor.cs
Creates ILogger<SqliteConcurrencyInterceptor> from options.LoggerFactory
Logs SQLITE_BUSY_SNAPSHOT (Warning), SQLITE_BUSY (Warning), and SQLITE_LOCKED (Error) in CommandFailed/CommandFailedAsync
Logs BEGIN IMMEDIATE upgrades at Debug level
Respects UpgradeTransactionsToImmediate = false; also now catches BEGIN DEFERRED
SqliteConnectionEnhancer.cs
Uses options.SynchronousMode.ToString().ToUpperInvariant() instead of hardcoded NORMAL
Added inline comments on every pragma explaining the reason, trade-off, and safe range
Added GetWalCheckpointStatusAsync() — runs PRAGMA wal_checkpoint(PASSIVE) and returns WalCheckpointStatus
SqliteConcurrencyExtensions.cs
Calls options.Validate() on startup
Retry now catches via SqliteErrorCodes.IsAnyBusy() (covers all extended codes); SQLITE_LOCKED propagates immediately
Backoff replaced with exponential + full jitter: sleep in [baseDelay, 2×baseDelay]
ThreadSafeSqliteContext.cs
Same SqliteErrorCodes-based retry; SQLITE_BUSY_SNAPSHOT restarts the full operation lambda (correct semantics — stale data is re-queried)
Jitter added to backoff
TimeoutException message now identifies whether it was a snapshot error and includes the extended error code
SqliteConcurrencyServiceCollectionExtensions.cs
Resolves ILoggerFactory from the DI container and injects it into options automatically
doc/QUICKSTART.md
Removed all UseWriteQueue references
Replaced the incorrect options table with the real six options, each with accurate defaults and descriptions1 parent 9fb4731 commit 87c2176
13 files changed
Lines changed: 689 additions & 109 deletions
File tree
- EntityFrameworkCore.Sqlite.Concurrency
- doc
- src
- ExtensionMethods
- Models
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
216 | 215 | | |
217 | 216 | | |
218 | 217 | | |
219 | | - | |
220 | | - | |
| 218 | + | |
221 | 219 | | |
222 | 220 | | |
223 | 221 | | |
| |||
254 | 252 | | |
255 | 253 | | |
256 | 254 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
262 | 261 | | |
263 | 262 | | |
264 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 85 | + | |
92 | 86 | | |
93 | 87 | | |
94 | 88 | | |
| |||
114 | 108 | | |
115 | 109 | | |
116 | 110 | | |
117 | | - | |
118 | | - | |
| 111 | + | |
119 | 112 | | |
120 | 113 | | |
121 | 114 | | |
| |||
136 | 129 | | |
137 | 130 | | |
138 | 131 | | |
139 | | - | |
140 | 132 | | |
141 | 133 | | |
142 | 134 | | |
| |||
Lines changed: 24 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| |||
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
148 | | - | |
149 | | - | |
| 152 | + | |
| 153 | + | |
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
| |||
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
182 | | - | |
183 | | - | |
| 186 | + | |
| 187 | + | |
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| |||
208 | 212 | | |
209 | 213 | | |
210 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
211 | 220 | | |
212 | 221 | | |
213 | 222 | | |
| |||
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
21 | 28 | | |
22 | 29 | | |
23 | 30 | | |
| |||
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
30 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
31 | 46 | | |
32 | | - | |
| 47 | + | |
33 | 48 | | |
34 | 49 | | |
35 | | - | |
| 50 | + | |
0 commit comments