Support the ongoing development of Laravel.io →
Database Eloquent Queues
Last updated 2 years ago.
0

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);


    



Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

abelgo abelgo Joined 15 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.