Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MySQL Close cursor and connection on commit #857

Merged
merged 2 commits into from
Sep 30, 2023

Conversation

felipehertzer
Copy link
Contributor

Hi @josephmancuso,

I'm having issues with lots of timeouts/open connections, where it seems like the connection isn't being closed.

I was checking MySQLConnection, and I saw that it never closes the cursor, I believe it could cause a memory leak.

I also identified that if I use transactions it will never close the connection, because the code is checking to close the connection in the query function and not in the commit function. Example:

DB.begin_transaction()
QueryBuilder().table('user').update('status', 1)
DB.commit()

This is pull request is an idea, I'm happy to discuss any solution.

Thanks.

@josephmancuso josephmancuso merged commit 1adac4b into MasoniteFramework:2.0 Sep 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants