-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem with transactions #50
Comments
SingleStoreDB supports the following flow fine:
So I don't think that's the issue. If I had to guess it may be due to how PHP does connection pooling. Can you disable PDO and see if the issue reproduces? |
There is no problem if I run it on the console as you told me. and it's the result of testing with the same source. laravel + mysql driver + mysql = work laravel + mysql driver + singlestore = didn't work laravel + singlestore driver + singlestore = didn't work |
After investigation, it appears that SingleStore does not clear client transaction state the same way that MySQL does after a rollback. This unfortunately means that based on how PDO/MySQL is written, you will need to force the server status to be re-read on the client after issuing a ROLLBACK. This is not needed after COMMIT as SingleStore sets the server status correctly in that case. The fastest way I currently know how to re-read the server status is the following: DB::beginTransaction();
DB::rollBack();
DB::insert('select 1');
DB::beginTransaction();
DB::rollBack(); I will leave this issue open until SingleStore fixes the bug and it's shipped. |
An error occurs when trying multiple transactions at once.
example code
The code below works normally on mysql, but an error occurs on singlestore.
Is it a natural result due to the difference between single store and mysql?
Or is it an error that needs to be corrected?
environment
php 8.1.13
laravel 9.45
singlestoredb-laravel 1.4.1
singlestore db version 8.0.4
The text was updated successfully, but these errors were encountered: