Category : innodb

Issue – I have failing workers because of Deadlock caused at JOBS table, while deleting entries of jobs. This behaviour is frequent in occurrence, even over slight increase in traffic. Need suggestions to avoid this Deadlock ? Configuration – Using Laravel queues with QUEUE_DRIVER=database Supervisor as queue manger DB is MySQL Logs – {"message":"SQLSTATE[40001]: Serialization ..

Read more

lockForUpdate() and sharedLock() are functions in Laravel Eloquent to set exclusive or shared locks (documentation here). However, I couldnt find a nice syntax to apply this on a single, already instantiated Eloquent model. Consider the following example code: DB::transaction(function() { // Find the user with ID = 1. $user = User::find(1); $user->lockForUpdate()->update([ ‘balance’ => $user->balance ..

Read more