GitHub PullRequestReviewCommentEvent at 2014-03-17 13:14:54
Repository: Propel2
Actor: gharlan
Payload: {"comment":{"url":"https://api.github.com/repos/propelorm/Propel2/pulls/comments/10655110","id":10655110,"diff_hunk":"@@ -1388,18 +1388,11 @@ public static function doInsert(\\$criteria, ConnectionInterface \\$con = null)\n         // Set the correct dbName\n         \\$query = \" . $this->getQueryClassName() . \"::create()->mergeWith(\\$criteria);\n \n-        try {\n-            // use transaction because \\$criteria could contain info\n-            // for more than one table (I guess, conceivably)\n-            \\$con->beginTransaction();\n-            \\$pk = \\$query->doInsert(\\$con);\n-            \\$con->commit();\n-        } catch (PropelException \\$e) {\n-            \\$con->rollBack();\n-            throw \\$e;\n-        }\n-\n-        return \\$pk;\n+        // use transaction because \\$criteria could contain info\n+        // for more than one table (I guess, conceivably)\n+        return \\$con->transaction(function () use (\\$con, \\$query) {\n+            return \\$query->doInsert(\\$con);\n+        });","path":"src/Propel/Generator/Builder/Om/TableMapBuilder.php","position":20,"original_position":20,"commit_id":"d11382099408f08b6a9780b39d5feed0a9c1ca8f","original_commit_id":"d11382099408f08b6a9780b39d5feed0a9c1ca8f","user":{"login":"gharlan","id":330436,"avatar_url":"https://gravatar.com/avatar/cb825376f450b60a765fe95080307ef5?d=https%3A%2F%2Fidenticons.github.com%2Fd174b915ac8bc6a71527159203fd207d.png&r=x","gravatar_id":"cb825376f450b60a765fe95080307ef5","url":"https://api.github.com/users/gharlan","html_url":"https://github.com/gharlan","followers_url":"https://api.github.com/users/gharlan/followers","following_url":"https://api.github.com/users/gharlan/following{/other_user}","gists_url":"https://api.github.com/users/gharlan/gists{/gist_id}","starred_url":"https://api.github.com/users/gharlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gharlan/subscriptions","organizations_url":"https://api.github.com/users/gharlan/orgs","repos_url":"https://api.github.com/users/gharlan/repos","events_url":"https://api.github.com/users/gharlan/events{/privacy}","received_events_url":"https://api.github.com/users/gharlan/received_events","type":"User","site_admin":false},"body":"ok","created_at":"2014-03-17T13:14:54Z","updated_at":"2014-03-17T13:14:54Z","html_url":"https://github.com/propelorm/Propel2/pull/578#discussion_r10655110","pull_request_url":"https://api.github.com/repos/propelorm/Propel2/pulls/578","_links":{"self":{"href":"https://api.github.com/repos/propelorm/Propel2/pulls/comments/10655110"},"html":{"href":"https://github.com/propelorm/Propel2/pull/578#discussion_r10655110"},"pull_request":{"href":"https://api.github.com/repos/propelorm/Propel2/pulls/578"}}}}