OK I found the solution here.
The problem is not related to concurrency.
The issue is that when calling a stored procedure using the PDO if the procedure returns a result set and you do not fetch all the rows in it the next time you use the DB connection this error will be occur.
Closing the statement and calling closeCursor(); is not sufficient
$stmt = DB::connection()->getPdo()->prepare("CALL credit_account(?)");
$stmt->bindParam(1, $id);
$stmt->execute();
$stmt->closeCursor();
use the DB connection to do any thing
ERROR Packets out of order. Expected 1 received 16. Packet size=7
the work around is to well always use the result set returned by the prepared call if you need it or not.
Check out
bugs.mysql . com/bug.php?id=68359
Edit.
This solution only half fixed the problem and resulted in some some inconsistent behaviour
This fixed it
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community