Commit 6226a07
committed
Add full support for protocol.LAST_COMMIT_INFO (#45)
Previously the LAST_COMMIT_INFO feature was only supported at the
protocol level: the driver always reported there was no information
available about the last commit.
Last commit ensures "read your own writes" capability for committed
transactions, even when connections are using different TEs.
Implement an internal structure to store last commit information:
- The information is saved as a process-wide set of data
- Allows the same process to connect to different databases, and to
connect to the same database multiple times (to the same or to
different TEs).
In order to support Python clients that may use threading with different
connections, use a Lock() to access the last commit details. Python
threading doesn't provide reader/writer locks; rather than write one
we'll use a simple mutex and assume this won't be a performance
bottleneck.
Add a reset() method to forget all information about previously
connected databases. This is not required since each database has its
own UUID, but can free up resources for long-running applications that
connect to lots of different databases.1 parent fd65998 commit 6226a07
2 files changed
Lines changed: 63 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
62 | 74 | | |
63 | 75 | | |
64 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
106 | 123 | | |
107 | 124 | | |
108 | 125 | | |
| |||
143 | 160 | | |
144 | 161 | | |
145 | 162 | | |
146 | | - | |
| 163 | + | |
147 | 164 | | |
148 | 165 | | |
149 | 166 | | |
| |||
210 | 227 | | |
211 | 228 | | |
212 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
213 | 236 | | |
214 | 237 | | |
215 | 238 | | |
| |||
257 | 280 | | |
258 | 281 | | |
259 | 282 | | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
260 | 290 | | |
261 | 291 | | |
262 | 292 | | |
| |||
268 | 298 | | |
269 | 299 | | |
270 | 300 | | |
| 301 | + | |
271 | 302 | | |
272 | 303 | | |
273 | 304 | | |
| |||
309 | 340 | | |
310 | 341 | | |
311 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
312 | 350 | | |
313 | 351 | | |
314 | 352 | | |
| |||
322 | 360 | | |
323 | 361 | | |
324 | 362 | | |
| 363 | + | |
325 | 364 | | |
326 | 365 | | |
327 | 366 | | |
| |||
370 | 409 | | |
371 | 410 | | |
372 | 411 | | |
| 412 | + | |
373 | 413 | | |
374 | 414 | | |
375 | 415 | | |
| |||
408 | 448 | | |
409 | 449 | | |
410 | 450 | | |
| 451 | + | |
| 452 | + | |
411 | 453 | | |
412 | 454 | | |
413 | 455 | | |
| |||
1127 | 1169 | | |
1128 | 1170 | | |
1129 | 1171 | | |
1130 | | - | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
1131 | 1178 | | |
1132 | 1179 | | |
1133 | 1180 | | |
| |||
1164 | 1211 | | |
1165 | 1212 | | |
1166 | 1213 | | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
| |||
0 commit comments