{"comment":{"url":"https://api.github.com/repos/zbindenren/negroni-mongo/comments/14998368","html_url":"https://github.com/zbindenren/negroni-mongo/commit/2f078a4f101524dbe2f192e09af3c85356e531c6#commitcomment-14998368","id":14998368,"user":{"login":"zbindenren","id":1607088,"avatar_url":"https://avatars.githubusercontent.com/u/1607088?v=3","gravatar_id":"","url":"https://api.github.com/users/zbindenren","html_url":"https://github.com/zbindenren","followers_url":"https://api.github.com/users/zbindenren/followers","following_url":"https://api.github.com/users/zbindenren/following{/other_user}","gists_url":"https://api.github.com/users/zbindenren/gists{/gist_id}","starred_url":"https://api.github.com/users/zbindenren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbindenren/subscriptions","organizations_url":"https://api.github.com/users/zbindenren/orgs","repos_url":"https://api.github.com/users/zbindenren/repos","events_url":"https://api.github.com/users/zbindenren/events{/privacy}","received_events_url":"https://api.github.com/users/zbindenren/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":null,"commit_id":"2f078a4f101524dbe2f192e09af3c85356e531c6","created_at":"2015-12-15T21:49:33Z","updated_at":"2015-12-15T21:49:33Z","body":"Yes, usually the approach is to do a mgo Dial and then Copy the connection at the beginning of every request handling, at the end of every request the copied session is closed. \r\n\r\nFrom the doc:\r\nNew sessions are typically created by calling session.Copy on the initial session obtained at dial time. These new sessions will share the same cluster information and connection cache, and may be easily handed into other methods and functions for organizing logic. Every session created must have its Close method called at the end of its life time, so its resources may be put back in the pool or collected, depending on the case."}}