You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RemoteDatabase.transaction() retries a joined transaction and never rolls back a failed attempt - two guards LocalDatabase has (one citing #661) #7030
RemoteDatabase.transaction() is missing two guards that LocalDatabase.transaction() has, one of which carries an in-code comment naming the issue (#661) that established it. The result: a retry can fire on a transaction the caller owns, and a failed attempt never rolls back the server-side transaction before the next attempt races it.
Where (HEAD c50338bd8)
LocalDatabase.java, the retry catch arm - the guard and the rollback:
} catch (finalNeedRetryException | DuplicatedKeyExceptione) {
// #661: when we joined a transaction owned by the caller (createdNewTx == false) we must NOT retry
...
if (!createdNewTx)
throwe;
...
if (wrappedDatabaseInstance.isTransactionActive())
wrappedDatabaseInstance.rollback();
and its catch (final Throwable e) arm also rolls back before rethrowing.
network/src/main/java/com/arcadedb/remote/RemoteDatabase.java:244-266 has neither. Both catch arms - catch (NeedRetryException | DuplicatedKeyException) and catch (Exception) - go straight to the error callback and the loop, with no !createdNewTx test and no rollback() anywhere in the method's failure paths.
The two implementations are otherwise structurally identical: the same for (int retry = 0; retry < attempts; ++retry), the same if (joinCurrentTransaction && isTransactionActive()) createdNewTx = false; else begin();. So this is a parity gap, not a design difference.
Impact, part 1 - retrying a transaction the caller owns
transaction(block, true) that joins an outer transaction and then hits a NeedRetryException re-runs block inside the caller's still-open transaction. The caller's transaction accumulates the partial effects of the failed attempt plus the retry, and the caller is never told. That is exactly what #661 fixed locally.
Impact, part 2 - no rollback before the retry
Each failed attempt leaves the server-side transaction open, holding its locks. The loop then immediately begins a new one, so attempt N+1 contends with the locks of attempt N, which makes a NeedRetryException more likely rather than less - the retry can make the situation worse. On the final failure the server-side transaction is left open until its own timeout.
Suggested fix
Port both guards:
} catch (finalNeedRetryException | DuplicatedKeyExceptione) {
if (!createdNewTx)
throwe;
if (isTransactionActive())
rollback();
...
and add the rollback() to the general catch arm too. rollback() already exists on this class (:391) and sends POST /rollback.
Worth extracting the shared retry policy so the two implementations cannot drift again - that drift is what this issue is.
Scope / confidence
High. Both methods read end to end and compared; the #661 comment in the local one is direct evidence the guard is required rather than incidental.
RemoteDatabase.transaction() now behaves like the embedded one on failure:
It no longer retries a transaction you own. If you call transaction(block, true) from inside a transaction you opened yourself and the block hits a concurrency conflict, the block used to be re-run inside your still-open transaction, quietly leaving the partial effects of the failed attempt behind. Now the exception reaches you and you decide how to retry the whole unit of work.
Every failed attempt is rolled back before the next one. Previously the failed attempt's server-side transaction was left open holding its locks until the server timed it out, so the retry competed with the attempt that had just failed and was more likely to fail again, not less.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Activity
Merge pull request #7085 from ArcadeData/fix/issue-7031-7030-remote-c…
lvca commentedon Sep 3, 2026
Fixed in #7085, milestone 26.9.1.
RemoteDatabase.transaction()now behaves like the embedded one on failure:transaction(block, true)from inside a transaction you opened yourself and the block hits a concurrency conflict, the block used to be re-run inside your still-open transaction, quietly leaving the partial effects of the failed attempt behind. Now the exception reaches you and you decide how to retry the whole unit of work.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Fix remote client: batch re-send after a failed flush, existsBucket s…