{"action":"created","issue":{"url":"https://api.github.com/repos/influitive/apartment/issues/311","repository_url":"https://api.github.com/repos/influitive/apartment","labels_url":"https://api.github.com/repos/influitive/apartment/issues/311/labels{/name}","comments_url":"https://api.github.com/repos/influitive/apartment/issues/311/comments","events_url":"https://api.github.com/repos/influitive/apartment/issues/311/events","html_url":"https://github.com/influitive/apartment/issues/311","id":153668689,"number":311,"title":"Apartment with threaded server (Puma)","user":{"login":"vladra","id":2317652,"avatar_url":"https://avatars.githubusercontent.com/u/2317652?v=3","gravatar_id":"","url":"https://api.github.com/users/vladra","html_url":"https://github.com/vladra","followers_url":"https://api.github.com/users/vladra/followers","following_url":"https://api.github.com/users/vladra/following{/other_user}","gists_url":"https://api.github.com/users/vladra/gists{/gist_id}","starred_url":"https://api.github.com/users/vladra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladra/subscriptions","organizations_url":"https://api.github.com/users/vladra/orgs","repos_url":"https://api.github.com/users/vladra/repos","events_url":"https://api.github.com/users/vladra/events{/privacy}","received_events_url":"https://api.github.com/users/vladra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-08T17:55:11Z","updated_at":"2016-05-09T09:12:11Z","closed_at":null,"body":"Hi guys,\r\n\r\nAnyone have success using Apartment gem with Puma?\r\n\r\nI'm encountering problem, which is caused by multiple threads. If I have more then 1 thread available, and bunch of ajax requests are fired at the same time, 1 or 2 of requests hitting default DB, instead of Tenant DB.\r\n\r\nIt seems that some part of Apartment is not thread safe?\r\n\r\nHas anyone encountered same issue? Any tips where should I look at? I'm using Postgres with separate databases (not schemas) setup.\r\n\r\nFor now I reduced Puma threads to 1 per worker, and this solved my issue temporary."},"comment":{"url":"https://api.github.com/repos/influitive/apartment/issues/comments/217814336","html_url":"https://github.com/influitive/apartment/issues/311#issuecomment-217814336","issue_url":"https://api.github.com/repos/influitive/apartment/issues/311","id":217814336,"user":{"login":"mikecmpbll","id":1962801,"avatar_url":"https://avatars.githubusercontent.com/u/1962801?v=3","gravatar_id":"","url":"https://api.github.com/users/mikecmpbll","html_url":"https://github.com/mikecmpbll","followers_url":"https://api.github.com/users/mikecmpbll/followers","following_url":"https://api.github.com/users/mikecmpbll/following{/other_user}","gists_url":"https://api.github.com/users/mikecmpbll/gists{/gist_id}","starred_url":"https://api.github.com/users/mikecmpbll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikecmpbll/subscriptions","organizations_url":"https://api.github.com/users/mikecmpbll/orgs","repos_url":"https://api.github.com/users/mikecmpbll/repos","events_url":"https://api.github.com/users/mikecmpbll/events{/privacy}","received_events_url":"https://api.github.com/users/mikecmpbll/received_events","type":"User","site_admin":false},"created_at":"2016-05-09T09:12:11Z","updated_at":"2016-05-09T09:12:11Z","body":"ah okay, fair enough, i don't know much about pg. i'm doing some work on the PR today."}}