Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1690,10 +1690,13 @@ public SyncRecord getSyncRecordForCurrentTx() {
public SyncRecord endTransaction(Transaction tx) {
SyncRecord record = syncRecords.remove(tx);
Transaction expected = transactions.pop();
processRegistered.remove(tx);
if (transactions.isEmpty()) {
syncRecordThreadLocal.remove();
}
if (record == null || expected == null || !expected.equals(tx)) {
throw new IllegalStateException("Ending transaction did not find the expected transaction on the stack");
}
syncRecordThreadLocal.get().setProcessRegistered(tx, false);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

processRegistered is a thread local variable that is used to record if a transaction has been to be registered on a current thread, and this changes things so that when we end a transaction instead of just setting the that the key-value to false it removes that record entirely? It also makes sure the transaction gets removed in case of n error case? This all makes sense.

return record;
}
}
Expand Down