{"action":"created","issue":{"url":"https://api.github.com/repos/omnifaces/cdi-ejb/issues/1","repository_url":"https://api.github.com/repos/omnifaces/cdi-ejb","labels_url":"https://api.github.com/repos/omnifaces/cdi-ejb/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/omnifaces/cdi-ejb/issues/1/comments","events_url":"https://api.github.com/repos/omnifaces/cdi-ejb/issues/1/events","html_url":"https://github.com/omnifaces/cdi-ejb/pull/1","id":136644709,"number":1,"title":"Interceptor for PooledScoped beans","user":{"login":"OndrejM","id":2195988,"avatar_url":"https://avatars.githubusercontent.com/u/2195988?v=3","gravatar_id":"","url":"https://api.github.com/users/OndrejM","html_url":"https://github.com/OndrejM","followers_url":"https://api.github.com/users/OndrejM/followers","following_url":"https://api.github.com/users/OndrejM/following{/other_user}","gists_url":"https://api.github.com/users/OndrejM/gists{/gist_id}","starred_url":"https://api.github.com/users/OndrejM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OndrejM/subscriptions","organizations_url":"https://api.github.com/users/OndrejM/orgs","repos_url":"https://api.github.com/users/OndrejM/repos","events_url":"https://api.github.com/users/OndrejM/events{/privacy}","received_events_url":"https://api.github.com/users/OndrejM/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-26T09:37:19Z","updated_at":"2016-03-14T11:11:52Z","closed_at":"2016-03-14T11:11:52Z","pull_request":{"url":"https://api.github.com/repos/omnifaces/cdi-ejb/pulls/1","html_url":"https://github.com/omnifaces/cdi-ejb/pull/1","diff_url":"https://github.com/omnifaces/cdi-ejb/pull/1.diff","patch_url":"https://github.com/omnifaces/cdi-ejb/pull/1.patch"},"body":"I see that PooledContext uses Javassist to wrap pooled beans and release them after method is called. I tried and idea to combine PooledContext together with an Interceptor, which does the release work instead of Javassist. The tricky part is communication between PooledContext and interceptor - I used thread local variable, but I still have some issues with nested calls to pooled beans in the same thread. But I think that can be resolved easily with putting nested beans on stack instead of using only single value in thread local.\r\n\r\nI removed Javassist dependency, the interceptor is bound automatically to beans marked with Pooled annotation (does not support producers yet).\r\n\r\nDo you whink this idea is viable? I also wrote some tests to demonstrate, but for some reasons I could not put the test code inside the same project (CDI extension was not loaded). If you think this approach makes sense, I my elaborate more."},"comment":{"url":"https://api.github.com/repos/omnifaces/cdi-ejb/issues/comments/196262472","html_url":"https://github.com/omnifaces/cdi-ejb/pull/1#issuecomment-196262472","issue_url":"https://api.github.com/repos/omnifaces/cdi-ejb/issues/1","id":196262472,"user":{"login":"janbeernink","id":1215417,"avatar_url":"https://avatars.githubusercontent.com/u/1215417?v=3","gravatar_id":"","url":"https://api.github.com/users/janbeernink","html_url":"https://github.com/janbeernink","followers_url":"https://api.github.com/users/janbeernink/followers","following_url":"https://api.github.com/users/janbeernink/following{/other_user}","gists_url":"https://api.github.com/users/janbeernink/gists{/gist_id}","starred_url":"https://api.github.com/users/janbeernink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janbeernink/subscriptions","organizations_url":"https://api.github.com/users/janbeernink/orgs","repos_url":"https://api.github.com/users/janbeernink/repos","events_url":"https://api.github.com/users/janbeernink/events{/privacy}","received_events_url":"https://api.github.com/users/janbeernink/received_events","type":"User","site_admin":false},"created_at":"2016-03-14T11:11:52Z","updated_at":"2016-03-14T11:11:52Z","body":"We've managed to find another interceptor based approach that works without Javassist. As a result, I will close this pull request. Once again, many thanks for your interest and your pull request!"}}