mirror of
https://github.com/Qortal/qortal.git
synced 2025-02-14 11:15:49 +00:00
Potential fix for rare HSQLDB "serialization failure" in Transaction.importAsUnconfirmed()
This commit is contained in:
parent
219f82f562
commit
9c48343581
@ -782,6 +782,16 @@ public abstract class Transaction {
|
||||
if (validationResult != ValidationResult.OK)
|
||||
return validationResult;
|
||||
|
||||
/*
|
||||
* We call discardChanges() to restart repository 'transaction', discarding any
|
||||
* transactional table locks, hence reducing possibility of deadlock or
|
||||
* "serialization failure" with HSQLDB due to reads.
|
||||
*
|
||||
* We should be OK to proceed after validation check as we're protected by
|
||||
* BLOCKCHAIN_LOCK so no other thread will be writing the same transaction.
|
||||
*/
|
||||
repository.discardChanges();
|
||||
|
||||
repository.getTransactionRepository().save(transactionData);
|
||||
repository.getTransactionRepository().unconfirmTransaction(transactionData);
|
||||
repository.saveChanges();
|
||||
|
Loading…
x
Reference in New Issue
Block a user