{"action":"closed","issue":{"url":"https://api.github.com/repos/juriansluiman/SlmQueue/issues/177","labels_url":"https://api.github.com/repos/juriansluiman/SlmQueue/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/juriansluiman/SlmQueue/issues/177/comments","events_url":"https://api.github.com/repos/juriansluiman/SlmQueue/issues/177/events","html_url":"https://github.com/juriansluiman/SlmQueue/issues/177","id":126021664,"number":177,"title":"Best practice question surrounding connection-sensitive dependencies (e.g., database connections)","user":{"login":"jackdpeterson","id":938961,"avatar_url":"https://avatars.githubusercontent.com/u/938961?v=3","gravatar_id":"","url":"https://api.github.com/users/jackdpeterson","html_url":"https://github.com/jackdpeterson","followers_url":"https://api.github.com/users/jackdpeterson/followers","following_url":"https://api.github.com/users/jackdpeterson/following{/other_user}","gists_url":"https://api.github.com/users/jackdpeterson/gists{/gist_id}","starred_url":"https://api.github.com/users/jackdpeterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackdpeterson/subscriptions","organizations_url":"https://api.github.com/users/jackdpeterson/orgs","repos_url":"https://api.github.com/users/jackdpeterson/repos","events_url":"https://api.github.com/users/jackdpeterson/events{/privacy}","received_events_url":"https://api.github.com/users/jackdpeterson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-11T19:46:37Z","updated_at":"2016-01-14T06:39:58Z","closed_at":"2016-01-14T06:39:58Z","body":"When using serices that rely on Doctrine ORM or otherwise on may get periodic database connection error (entity manager closed), or PDO failures if just using straight PDO. MySQL in particular kills a connection after an hour. Because SlmQueue jobs are effectively long-running php processes and *could* be terminated using a variety of strategies (I didn't see time in there) I'm curious about what other devs are doing to ensure that connection-sensitive services are fresh and operating while keeping code as DRY as possible (not repeating the connection reset logic per-job or called method). \r\n\r\n\r\nA few questions for discussion:\r\n\r\n1. Where are folks placing connection detection / close / re-open logic?\r\n2. How has your strategy worked overall in terms of stability and/or performance impacts with the reset logic?\r\n\r\n\r\nbased on the output of this open issue, I'll create a PR to document the discussed 'best practice' because I think it's relevant to anyone who's in a discovery process / testing out implementing this module in a test / production environment."}}