-
Notifications
You must be signed in to change notification settings - Fork 65
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
Reuse existing MySQL connection #245
Reuse existing MySQL connection #245
Conversation
…isting MySQL database connection.
I think this is a great opportunity to start implementing improvements pointed out by @tuxayo in #77:
Could we get the common DBService.php file updated along with the others to start bringing it in line so that it could eventually be the single DBService.php file across CORAL? Do others think this is the right approach to begin moving in this direction? |
Yes! I think DBService.php would be a great place to start using a true common architecture. |
I think these two should be addressed separately:
The first one could be quickly fixed (and is needed imho). About reusing the mysql connection, I already made a patch (should have done a pull request, my bad), for information, it's there: biblibre@18d0172 (from #145 ) |
@veggiematts , I agree to your two step approach. As to the patch you made much earlier, it's very similar to this one, except that your patch contains changes in other files not only in DBService.php. Interesting~ |
Just to clarify my comment above… I’m not suggesting we switch anything over to a common architecture yet. That is too big of a step that will require lots of review and testing. I’m just asking that going forward, we makes steps in that direction. If we always put it off, it will never happen. Starting small should make it more manageable. In this case it would only require adding the changes made in the individual DBService.php files into the common one. That common DBService.php file wouldn’t be called by any of the modules at this time, but it starts a pattern of working toward the goal of a common architecture. |
Totally agreed.
Mang
…On 6/23/2017 12:19 PM, Tommy Keswick wrote:
Just to clarify my comment above…
I’m not suggesting we switch anything over to a common architecture
yet. That is too big of a step that will require lots of review and
testing.
I’m just asking that going forward, we makes steps in that direction.
If we always put it off, it will never happen. Starting small should
make it more manageable.
In this case it would only require adding the changes made in the
individual DBService.php files into the common one.
That common DBService.php file wouldn’t be called by any of the
modules at this time, but it starts a pattern of working toward the
goal of a common architecture.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#245 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK7jvK0CxBJhhEgfEPFDrztpkKK_x3Qvks5sG_OlgaJpZM4OBL6S>.
|
t4k: can I say that the short term vision is fixing the performance delay, while the long term one is to switching to a better architecture, small step by small step ? |
Can anyone confirm this was resolved with #292? If so, please comment and close the PR. |
Closing this as #343 was merged. |
Update DBService.php of all modules except the Report one to reuse existing MySQL database connection. A new private static property called $currDBH is introduced into the DBService class. This property is used to store existing database connection. In order to keep number of changes small, the original instance property $db is kept and its value is set with the value of $currDBH whenever existing connection is available. Without this fix, Coral opens as many database connections as number of child records until request for new connection is silently rejected and sees no records returned at all when processing child records (e.g., License record).