This repository was archived by the owner on Apr 7, 2026. It is now read-only.
Commit 4652157
committed
feat: Add ClientContext support to Connection API
This change adds support for setting and propagating ClientContext in the
Spanner Connection API. ClientContext allows propagating client-scoped
session state (e.g., secure parameters) to Spanner RPCs.
- Added setClientContext/getClientContext to Connection interface and implementation.
- Implemented state propagation from Connection to UnitOfWork and its implementations (ReadWriteTransaction, SingleUseTransaction).
- Fixed accidental import removal in OptionsTest.java.
- Fixed TransactionRunnerImplTest to correctly verify ClientContext propagation.
- Added ClientContextMockServerTest for end-to-end verification.1 parent 8669fe0 commit 4652157
9 files changed
Lines changed: 451 additions & 13 deletions
File tree
- google-cloud-spanner/src
- main/java/com/google/cloud/spanner/connection
- test/java/com/google/cloud/spanner
- connection
google-cloud-spanner/src/main/java/com/google/cloud/spanner/connection/AbstractBaseUnitOfWork.java
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| |||
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| 121 | + | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
| |||
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
166 | 173 | | |
167 | 174 | | |
168 | 175 | | |
| |||
179 | 186 | | |
180 | 187 | | |
181 | 188 | | |
| 189 | + | |
182 | 190 | | |
183 | 191 | | |
184 | 192 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
452 | 471 | | |
453 | 472 | | |
454 | 473 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
299 | 300 | | |
300 | 301 | | |
301 | 302 | | |
| 303 | + | |
302 | 304 | | |
303 | 305 | | |
304 | 306 | | |
| |||
536 | 538 | | |
537 | 539 | | |
538 | 540 | | |
| 541 | + | |
539 | 542 | | |
540 | 543 | | |
541 | 544 | | |
| |||
955 | 958 | | |
956 | 959 | | |
957 | 960 | | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
958 | 973 | | |
959 | 974 | | |
960 | 975 | | |
| |||
2026 | 2041 | | |
2027 | 2042 | | |
2028 | 2043 | | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
2029 | 2047 | | |
2030 | 2048 | | |
2031 | 2049 | | |
| |||
2070 | 2088 | | |
2071 | 2089 | | |
2072 | 2090 | | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
2073 | 2099 | | |
2074 | 2100 | | |
2075 | 2101 | | |
| |||
2299 | 2325 | | |
2300 | 2326 | | |
2301 | 2327 | | |
| 2328 | + | |
2302 | 2329 | | |
2303 | 2330 | | |
2304 | 2331 | | |
| |||
2317 | 2344 | | |
2318 | 2345 | | |
2319 | 2346 | | |
| 2347 | + | |
2320 | 2348 | | |
2321 | 2349 | | |
2322 | 2350 | | |
| |||
2340 | 2368 | | |
2341 | 2369 | | |
2342 | 2370 | | |
| 2371 | + | |
2343 | 2372 | | |
2344 | 2373 | | |
2345 | 2374 | | |
| |||
2359 | 2388 | | |
2360 | 2389 | | |
2361 | 2390 | | |
| 2391 | + | |
2362 | 2392 | | |
2363 | 2393 | | |
2364 | 2394 | | |
| |||
2369 | 2399 | | |
2370 | 2400 | | |
2371 | 2401 | | |
| 2402 | + | |
2372 | 2403 | | |
2373 | 2404 | | |
2374 | 2405 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
373 | 376 | | |
374 | 377 | | |
375 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
376 | 382 | | |
377 | 383 | | |
378 | 384 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
523 | 526 | | |
524 | 527 | | |
525 | 528 | | |
| |||
547 | 550 | | |
548 | 551 | | |
549 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
550 | 556 | | |
551 | 557 | | |
552 | 558 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| |||
Lines changed: 13 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
113 | 117 | | |
114 | 118 | | |
115 | 119 | | |
116 | | - | |
117 | | - | |
118 | | - | |
| 120 | + | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
0 commit comments