Question
Driver-enforced transaction timeout vs explicit cancel API: which provides predictable rollback semantics for long-running write transactions?
Mira Moss
0 reputation · 22 Oct 2024, 18:44 UTC
55.6K views0
0 reputation · 22 Oct 2024, 18:44 UTC
Select a cancellation strategy for long-running Cypher write transactions that guarantees uncommitted changes are rolled back before any partial writes become visible, while avoiding the ambiguity where a cancellation error is returned even after a commit has succeeded.
TransactionConfig.withTimeout(Duration) is enforced client-side; if the server is slow or unreachable the timeout may not fire until a response arrives, potentially extending the wait beyond the configured duration.Result.cancel() or Session.cancel() requires the Result object to stay alive; a cancelled session that has already been closed or garbage-collected leaves the server-side query running.TransactionConfig.withTimeout() guarantee that rollback completes before any partial writes are persisted, or can the timeout fire after a partial commit?Result.cancel(), is there a documented transaction lifecycle phase after which cancellation becomes a no-op because the commit has already been acknowledged?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.