{"issue":{"state":"open","created_at":"2011-11-20T23:52:44Z","updated_at":"2011-11-24T10:21:45Z","user":{"gravatar_id":"edd0be6c7c035b58bb2712284da41f1f","id":20300,"url":"https://api.github.com/users/springmeyer","login":"springmeyer","avatar_url":"https://secure.gravatar.com/avatar/edd0be6c7c035b58bb2712284da41f1f?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":1,"body":"When an exception happens in the postgis_datasource constructor, the ~postgis_datasource is never called (because the object was never fully created). Therefore, even if persist_connection=false, the connection pool entry for that datasource is never released. This makes it very difficult to write tests against the postgis datasource where databases need to get cleaned up because even at script exit mapnik's pool will still be holding onto a connection.\r\n\r\nThis also related a bit to #863","assignee":null,"number":960,"id":2300085,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[{"color":"207FAB","name":"postgis.input","url":"https://api.github.com/repos/mapnik/mapnik/labels/postgis.input"}],"title":"RAII problems in postgis.input","closed_at":null,"html_url":"https://github.com/mapnik/mapnik/issues/960","milestone":{"state":"open","created_at":"2011-10-11T15:50:22Z","closed_issues":16,"due_on":"2011-12-31T08:00:00Z","creator":{"gravatar_id":"941f68386168a8a6b60f2529a7830af7","id":59056,"url":"https://api.github.com/users/artemp","login":"artemp","avatar_url":"https://secure.gravatar.com/avatar/941f68386168a8a6b60f2529a7830af7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"number":8,"title":"Mapnik 2.1","description":"Next release in the Mapnik 2.x series - small non-feature fixes will go into [2.0.1](https://github.com/artemp/mapnik/issues?milestone=14).\r\n\r\nThis release series, 2.1.x, will feature any major new features.\r\n\r\nThis will be a backward-compatible series.","open_issues":36,"url":"https://api.github.com/repos/mapnik/mapnik/milestones/8"},"url":"https://api.github.com/repos/mapnik/mapnik/issues/960"},"action":"created","comment":{"created_at":"2011-11-24T10:21:45Z","updated_at":"2011-11-24T10:21:45Z","user":{"gravatar_id":"d8fd959452e612e13a70e01483e24592","id":707032,"url":"https://api.github.com/users/kunitoki","login":"kunitoki","avatar_url":"https://secure.gravatar.com/avatar/d8fd959452e612e13a70e01483e24592?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"Datasource should never bind themselves in the constructor. Like what Artem said, it's better to move the logic in the datasource management layer underneath, and catch exceptions there.","id":2860986,"url":"https://api.github.com/repos/mapnik/mapnik/issues/comments/2860986"}}