GitHub PullRequestReviewCommentEvent at 2014-04-10 16:49:11
Repository: crontabber
Actor: twobraids
Payload: {"comment":{"url":"https://api.github.com/repos/mozilla/crontabber/pulls/comments/11494259","id":11494259,"diff_hunk":"@@ -105,34 +119,40 @@ def __call__(self, name=None):\n \n         parameters:\n             name - an optional name for the database connection\"\"\"\n-        #self.config.logger.debug('acquiring connection')\n         conn = self.connection(name)\n         try:\n-            #self.config.logger.debug('connection acquired')\n             yield conn\n         finally:\n-            #self.config.logger.debug('connection closed')\n             self.close_connection(conn)\n \n     #--------------------------------------------------------------------------\n     def close_connection(self, connection, force=False):\n-        \"\"\"close the connection passed in.\n-\n-        This function exists to allow derived classes to override the closing\n-        behavior.\n-\n-        parameters:\n-            connection - the database connection object\n-            force - unused boolean to force closure; used in derived classes\n-        \"\"\"\n-        connection.close()\n+        \"\"\"overriding the baseclass function, this routine will decline to\n+        close a connection at the end of a transaction context.  This allows\n+        for reuse of connections.\"\"\"\n+        if force:\n+            try:\n+                connection.close()\n+            except self.operational_exceptions:\n+                self.config.logger.error('PostgresPooled - failed closing')","path":"crontabber/connection_context.py","position":117,"original_position":117,"commit_id":"0ea10fa2450fd322a16b9f07ada80ea0bdaadf71","original_commit_id":"0ea10fa2450fd322a16b9f07ada80ea0bdaadf71","user":{"login":"twobraids","id":581227,"avatar_url":"https://avatars.githubusercontent.com/u/581227?","gravatar_id":"532ea239a8414ba61b469614dfce6144","url":"https://api.github.com/users/twobraids","html_url":"https://github.com/twobraids","followers_url":"https://api.github.com/users/twobraids/followers","following_url":"https://api.github.com/users/twobraids/following{/other_user}","gists_url":"https://api.github.com/users/twobraids/gists{/gist_id}","starred_url":"https://api.github.com/users/twobraids/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twobraids/subscriptions","organizations_url":"https://api.github.com/users/twobraids/orgs","repos_url":"https://api.github.com/users/twobraids/repos","events_url":"https://api.github.com/users/twobraids/events{/privacy}","received_events_url":"https://api.github.com/users/twobraids/received_events","type":"User","site_admin":false},"body":"\"PostgresPooled\"  -->  \"ConnectionFactory\"","created_at":"2014-04-10T16:49:11Z","updated_at":"2014-04-10T16:49:11Z","html_url":"https://github.com/mozilla/crontabber/pull/6#discussion_r11494259","pull_request_url":"https://api.github.com/repos/mozilla/crontabber/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/mozilla/crontabber/pulls/comments/11494259"},"html":{"href":"https://github.com/mozilla/crontabber/pull/6#discussion_r11494259"},"pull_request":{"href":"https://api.github.com/repos/mozilla/crontabber/pulls/6"}}}}