{"action":"opened","issue":{"url":"https://api.github.com/repos/typeorm/typeorm/issues/2602","repository_url":"https://api.github.com/repos/typeorm/typeorm","labels_url":"https://api.github.com/repos/typeorm/typeorm/issues/2602/labels{/name}","comments_url":"https://api.github.com/repos/typeorm/typeorm/issues/2602/comments","events_url":"https://api.github.com/repos/typeorm/typeorm/issues/2602/events","html_url":"https://github.com/typeorm/typeorm/issues/2602","id":345566977,"node_id":"MDU6SXNzdWUzNDU1NjY5Nzc=","number":2602,"title":"QueryRunner transaction example - Connection release needed?","user":{"login":"mashaalmemon","id":18560240,"node_id":"MDQ6VXNlcjE4NTYwMjQw","avatar_url":"https://avatars3.githubusercontent.com/u/18560240?v=4","gravatar_id":"","url":"https://api.github.com/users/mashaalmemon","html_url":"https://github.com/mashaalmemon","followers_url":"https://api.github.com/users/mashaalmemon/followers","following_url":"https://api.github.com/users/mashaalmemon/following{/other_user}","gists_url":"https://api.github.com/users/mashaalmemon/gists{/gist_id}","starred_url":"https://api.github.com/users/mashaalmemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mashaalmemon/subscriptions","organizations_url":"https://api.github.com/users/mashaalmemon/orgs","repos_url":"https://api.github.com/users/mashaalmemon/repos","events_url":"https://api.github.com/users/mashaalmemon/events{/privacy}","received_events_url":"https://api.github.com/users/mashaalmemon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-29T22:11:07Z","updated_at":"2018-07-29T22:11:07Z","closed_at":null,"author_association":"NONE","body":"**Issue type:**\r\n\r\n[x] question\r\n[ ] bug report\r\n[ ] feature request\r\n[ x] documentation issue\r\n\r\n**Database system/driver:**\r\n\r\n[ ] `cordova`\r\n[ ] `mongodb`\r\n[ ] `mssql`\r\n[ ] `mysql` / `mariadb`\r\n[ ] `oracle`\r\n[x] `postgres`\r\n[ ] `sqlite`\r\n[ ] `sqljs`\r\n[ ] `react-native`\r\n[ ] `expo`\r\n\r\n**TypeORM version:**\r\n\r\n[x] `latest`\r\n[ ] `@next`\r\n[ ] `0.x.x` (or put your version here)\r\n\r\n**Steps to reproduce or a small repository showing the problem:**\r\n\r\nHi there. Referring to your documentation and specifically the bit on [transactions](https://github.com/typeorm/typeorm/blob/master/docs/transactions.md), the QueryRunner example was appropriate for my case.\r\n\r\nMy question is, in the example a connection is created (using a connection from the connection pool I expect) like so:\r\n\r\n```js\r\n// get a connection and create a new query runner\r\nconst connection = getConnection();\r\nconst queryRunner = connection.createQueryRunner();\r\n\r\n// establish real database connection using our new query runner\r\nawait queryRunner.connect();\r\n\r\n// .. do stuff with queryRunner\r\n\r\ntry {\r\n    \r\n    // commit transaction now:\r\n    await queryRunner.commitTransaction();\r\n    \r\n} catch (err) {\r\n    \r\n    // since we have errors lets rollback changes we made\r\n    await queryRunner.rollbackTransaction();\r\n    \r\n}\r\n```\r\n\r\nHowever, what I wasn't clear on is whether, after commit/rollback, there is a need to explicitly release the connection created with perhaps:\r\n\r\n```js\r\nawait queryRunner.release();\r\n```\r\n\r\nThe [QuerryRunner documentation](https://github.com/typeorm/typeorm/blob/master/docs/query-runner.md) is currently incomplete/empty. \r\n\r\nPlease advise. "}}
{"actor":{"display_login":"mashaalmemon"}}