-
-
Couldn't load subscription status.
- Fork 246
Closed
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested
Description
Hi) i error race condition))
i have this code
$walletRefill = $user->getWalletRefill();
$walletHold = $user->getWalletHold();
try {
$walletRefill->transfer(
$walletHold,
$type,
[
'description' => 'Перевод средств для покупки очереди: ' . $type . '$'
]);
} catch (Exception $e) {
info(__CLASS__ . '(' . __LINE__ . ') ' . $e->getMessage());
return redirect(route('queue.buy.index', [
'user' => $user->id
]))->with('error', __($e->getMessage()));
}
when many users run this code, then I see such an error
App\Http\Controllers\Front\Queue\BuyController(69) SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction (SQL: update `wallets` set `balance` = 3820, `wallets`.`updated_at` = 2019-08-05 00:18:53 where `id` = 12)
--
Do you have any idea how to fix this?)))
tnx)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestquestionFurther information is requestedFurther information is requested