Commit 2912037
authored
Backport UnmanagedTransaction stage and completion improvements (#1069)
* Make UnmanagedTransaction return ongoing tx completion stage (#1057)
This update ensures that `UnmanagedTransaction` returns existing on-going tx completion stage when a similar request is made. For instance, if it was requested to be rolled back and then requested to be closed, both invocations should get the same on-going stage. In addition, it should not accept conflicting actions, like committing and rolling back at the same time.
In addition, it makes sure that cancellation on reactive transaction function results in rollback.
* Call close with the appropriate flag to commit or rollback on UnmanagedTransaction where possible to avoid double state acquisition (#1065)
* Call close with the appropriate flag to commit or rollback on UnmanagedTransaction where possible to avoid double state acquisition
Calling `close` instead of separate `isOpen` and `commitAsync` requires less lock acquisitions and is safer.
* Update tests1 parent 86220ae commit 2912037
File tree
8 files changed
+411
-229
lines changed- driver/src
- main/java/org/neo4j/driver/internal
- async
- reactive
- util
- test/java/org/neo4j/driver/internal
- async
- reactive
8 files changed
+411
-229
lines changedLines changed: 22 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 179 | + | |
| 180 | + | |
183 | 181 | | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
193 | 188 | | |
194 | 189 | | |
195 | 190 | | |
196 | 191 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
| 192 | + | |
| 193 | + | |
202 | 194 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
215 | 205 | | |
216 | 206 | | |
0 commit comments