Prevented edge case of committing before logging
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
parent
4cd09e31ee
commit
8ed0e171cc
|
@ -53,8 +53,8 @@ public class PersistenceManager {
|
|||
* @return transaction ID
|
||||
*/
|
||||
synchronized int beginTransaction() {
|
||||
_transactions.put(_nextTransactionNumber, false);
|
||||
log(_nextTransactionNumber, -1, "BOT", "");
|
||||
_transactions.put(_nextTransactionNumber, false);
|
||||
// return the next transaction number and increase it by one afterwards
|
||||
return _nextTransactionNumber++;
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ public class PersistenceManager {
|
|||
}
|
||||
// only perform commit actions if transaction isn't commited yet
|
||||
if (!_transactions.get(taid)) {
|
||||
_transactions.replace(taid, true);
|
||||
log(taid, -1, "COMMIT", "");
|
||||
_transactions.replace(taid, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue