summaryrefslogtreecommitdiff
path: root/sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
diff options
context:
space:
mode:
authorms <ms@taler.net>2021-09-22 14:32:51 +0200
committerms <ms@taler.net>2021-09-22 14:32:51 +0200
commitd446df589a1ce8f2364c933a839c437783700e09 (patch)
tree8c11e03a14c19e19ce4b77f5ed23bea66e71ac99 /sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt
parent197996d952573f0103567c4e5b33ba53b1a316cb (diff)
downloadlibeufin-d446df589a1ce8f2364c933a839c437783700e09.tar.gz
libeufin-d446df589a1ce8f2364c933a839c437783700e09.tar.bz2
libeufin-d446df589a1ce8f2364c933a839c437783700e09.zip
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.
Diffstat (limited to 'sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt')
-rw-r--r--sandbox/src/main/kotlin/tech/libeufin/sandbox/DB.kt4
1 files changed, 4 insertions, 0 deletions
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<Long>) : LongEntity(id) {
@@ -429,6 +431,8 @@ class TalerWithdrawalEntity(id: EntityID<Long>) : 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() {