try with row locking to avoid rollbacks (in theory, to be verified)

This commit is contained in:
Christian Grothoff 2018-08-09 22:27:43 +02:00
parent 68848aaf5c
commit bce6a80f38
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -682,7 +682,8 @@ postgres_prepare (PGconn *db_conn)
",execution_date"
",sender_account_details"
" FROM reserves_in"
" WHERE reserve_pub=$1;",
" WHERE reserve_pub=$1"
" FOR UPDATE;",
1),
/* Used in #postgres_insert_withdraw_info() to store
the signature of a blinded coin with the blinded coin's
@ -725,7 +726,8 @@ postgres_prepare (PGconn *db_conn)
" FROM reserves_out"
" JOIN denominations denom"
" USING (denom_pub_hash)"
" WHERE h_blind_ev=$1;",
" WHERE h_blind_ev=$1"
" FOR UPDATE;",
1),
/* Used during #postgres_get_reserve_history() to
obtain all of the /reserve/withdraw operations that
@ -747,7 +749,8 @@ postgres_prepare (PGconn *db_conn)
" FROM reserves_out"
" JOIN denominations denom"
" USING (denom_pub_hash)"
" WHERE reserve_pub=$1;",
" WHERE reserve_pub=$1"
" FOR UPDATE",
1),
/* Used in #postgres_select_reserves_out_above_serial_id() */
GNUNET_PQ_make_prepare ("audit_get_reserves_out_incr",
@ -1498,7 +1501,8 @@ postgres_prepare (PGconn *db_conn)
" USING (denom_pub_hash)"
" JOIN reserves_out ro"
" USING (h_blind_ev)"
" WHERE ro.reserve_pub=$1;",
" WHERE ro.reserve_pub=$1"
" FOR UPDATE;",
1),
/* Used in #postgres_get_reserve_history() */
GNUNET_PQ_make_prepare ("close_by_reserve",
@ -1513,7 +1517,8 @@ postgres_prepare (PGconn *db_conn)
",receiver_account"
",wtid"
" FROM reserves_close"
" WHERE reserve_pub=$1;",
" WHERE reserve_pub=$1"
" FOR UPDATE",
1),
/* Used in #postgres_get_expired_reserves() */
GNUNET_PQ_make_prepare ("get_expired_reserves",