Skip to content
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

Error in documentation wrt persistent MySQL connection #15241

Closed
DrJLT opened this issue Dec 25, 2020 · 1 comment · Fixed by #15419
Closed

Error in documentation wrt persistent MySQL connection #15241

DrJLT opened this issue Dec 25, 2020 · 1 comment · Fixed by #15419
Assignees
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report

Comments

@DrJLT
Copy link

DrJLT commented Dec 25, 2020

Hello,

In the documentation, it is written that 'persistent' is a parameter: https://docs.phalcon.io/4.0/en/db-layer#connect

As I've been tuning the code, I noticed that it doesn't really create a persistent connection. To do so, it's necessary to add

'options' => [\PDO::ATTR_PERSISTENT] => true

However, that is just an option passed to PDO. The MySQL adapter will continue to create new connections, because the adapter simply creates a connection each time it is called.

https://github.com/phalcon/cphalcon/blob/master/phalcon/Db/Adapter/Pdo/AbstractPdo.zep

This should be made clear in the documentation.

@Jeckerson Jeckerson added 5.0 The issues we want to solve in the 5.0 release bug A bug report documentation Documentation required status: unverified Unverified labels Mar 26, 2021
@niden niden linked a pull request Apr 21, 2021 that will close this issue
5 tasks
@niden niden removed documentation Documentation required status: unverified Unverified labels Apr 21, 2021
@niden
Copy link
Member

niden commented Apr 21, 2021

This was indeed an omission in the code. The persistent flag is now taken into account

Thank you @DrJLT for reporting this.

Resolved in #15419

@niden niden closed this as completed Apr 21, 2021
@niden niden moved this to Released in Phalcon v5 Aug 25, 2022
@niden niden added this to Phalcon v5 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 The issues we want to solve in the 5.0 release bug A bug report
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants