From d446df589a1ce8f2364c933a839c437783700e09 Mon Sep 17 00:00:00 2001 From: ms Date: Wed, 22 Sep 2021 14:32:51 +0200 Subject: Improve the 409 Conflict detection, address DB concurrency. The conflict now happens only if under the same withdraw operation ID the wallet tries to select two different exchanges or reserve public keys. As of DB concurrency, there is now one thread (named "DB") that should run all the database operations, in order to avoid conflicts on the disk. At this moment, and mostly to see where the current implementation fails with regard to concurrent DB access, not all the database operations were migrated into such thread. --- sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt') diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt index f1fbe561..ef6d3704 100644 --- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt +++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt @@ -422,6 +422,8 @@ object TalerWithdrawalsTable : LongIdTable() { * the payment arrived at the exchange's bank yet. */ val transferDone = bool("transferDone").default(false) + val reservePub = text("reservePub").nullable() + val selectedExchangePayto = text("selectedExchangePayto").nullable() } class TalerWithdrawalEntity(id: EntityID) : LongEntity(id) { @@ -429,6 +431,8 @@ class TalerWithdrawalEntity(id: EntityID) : LongEntity(id) { var wopid by TalerWithdrawalsTable.wopid var selectionDone by TalerWithdrawalsTable.selectionDone var transferDone by TalerWithdrawalsTable.transferDone + var reservePub by TalerWithdrawalsTable.reservePub + var selectedExchangePayto by TalerWithdrawalsTable.selectedExchangePayto } object BankAccountReportsTable : IntIdTable() { -- cgit v1.2.3