{"action":"created","comment":{"url":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments/43876785","id":43876785,"diff_hunk":"@@ -63,23 +69,43 @@ public DefaultSerializationProvider(DefaultSerializationProviderConfiguration co\n \n   @Override\n   public <T> Serializer<T> createKeySerializer(Class<T> clazz, ClassLoader classLoader, ServiceConfiguration<?>... configs) throws UnsupportedTypeException {\n+    Serializer<T> serializer;\n     if (findSingletonAmongst(PersistenceSpaceIdentifier.class, (Object[]) configs) == null) {\n-      return transientProvider.createKeySerializer(clazz, classLoader, configs);\n+      serializer = transientProvider.createKeySerializer(clazz, classLoader, configs); \n     } else {\n-      return persistentProvider.createKeySerializer(clazz, classLoader, configs);\n+      serializer = persistentProvider.createKeySerializer(clazz, classLoader, configs);\n     }\n+    created.add(serializer);\n+    return serializer;\n   }\n \n   @Override\n   public <T> Serializer<T> createValueSerializer(Class<T> clazz, ClassLoader classLoader, ServiceConfiguration<?>... configs) throws UnsupportedTypeException {\n+    Serializer<T> serializer;\n     if (findSingletonAmongst(PersistenceSpaceIdentifier.class, (Object[]) configs) == null) {\n-      return transientProvider.createValueSerializer(clazz, classLoader, configs);\n+      serializer = transientProvider.createValueSerializer(clazz, classLoader, configs);\n     } else {\n-      return persistentProvider.createValueSerializer(clazz, classLoader, configs);\n+      serializer = persistentProvider.createValueSerializer(clazz, classLoader, configs);\n     }\n+    created.add(serializer);\n+    return serializer;\n   }\n \n   @Override\n+  public void releaseSerializer(final Serializer<?> serializer) {\n+    if (!created.remove(serializer)) {\n+      throw new IllegalArgumentException(\"Given serializer: \" + serializer.getClass().getName() + \" is not managed by this provider\");\n+    }\n+    if(serializer instanceof CompactPersistentJavaSerializer) {","path":"impl/src/main/java/org/ehcache/spi/serialization/DefaultSerializationProvider.java","position":62,"original_position":62,"commit_id":"966656d703aea8ece91a92ce7a7ccf989d99f737","original_commit_id":"966656d703aea8ece91a92ce7a7ccf989d99f737","user":{"login":"ljacomet","id":135308,"avatar_url":"https://avatars.githubusercontent.com/u/135308?v=3","gravatar_id":"","url":"https://api.github.com/users/ljacomet","html_url":"https://github.com/ljacomet","followers_url":"https://api.github.com/users/ljacomet/followers","following_url":"https://api.github.com/users/ljacomet/following{/other_user}","gists_url":"https://api.github.com/users/ljacomet/gists{/gist_id}","starred_url":"https://api.github.com/users/ljacomet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljacomet/subscriptions","organizations_url":"https://api.github.com/users/ljacomet/orgs","repos_url":"https://api.github.com/users/ljacomet/repos","events_url":"https://api.github.com/users/ljacomet/events{/privacy}","received_events_url":"https://api.github.com/users/ljacomet/received_events","type":"User","site_admin":false},"body":"As stated in my previous comments, we want to invoke the former `close` method on all our Serializer implies. Same `Closeable` interface or new custom one?","created_at":"2015-11-04T12:55:39Z","updated_at":"2015-11-04T12:55:39Z","html_url":"https://github.com/ehcache/ehcache3/pull/664#discussion_r43876785","pull_request_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/664","_links":{"self":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments/43876785"},"html":{"href":"https://github.com/ehcache/ehcache3/pull/664#discussion_r43876785"},"pull_request":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/664"}}},"pull_request":{"url":"https://api.github.com/repos/ehcache/ehcache3/pulls/664","id":49684131,"html_url":"https://github.com/ehcache/ehcache3/pull/664","diff_url":"https://github.com/ehcache/ehcache3/pull/664.diff","patch_url":"https://github.com/ehcache/ehcache3/pull/664.patch","issue_url":"https://api.github.com/repos/ehcache/ehcache3/issues/664","number":664,"state":"open","locked":false,"title":"Introduce a resource releaser method for SerializationProvider as a precursor to the real fix for #635","user":{"login":"albinsuresh","id":1647963,"avatar_url":"https://avatars.githubusercontent.com/u/1647963?v=3","gravatar_id":"","url":"https://api.github.com/users/albinsuresh","html_url":"https://github.com/albinsuresh","followers_url":"https://api.github.com/users/albinsuresh/followers","following_url":"https://api.github.com/users/albinsuresh/following{/other_user}","gists_url":"https://api.github.com/users/albinsuresh/gists{/gist_id}","starred_url":"https://api.github.com/users/albinsuresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albinsuresh/subscriptions","organizations_url":"https://api.github.com/users/albinsuresh/orgs","repos_url":"https://api.github.com/users/albinsuresh/repos","events_url":"https://api.github.com/users/albinsuresh/events{/privacy}","received_events_url":"https://api.github.com/users/albinsuresh/received_events","type":"User","site_admin":false},"body":"1. The responsibility of closing a persistent serializer has been moved to the SerializationProvider via the releaseSerializer method. This way we achieve consistency in handling the life cycle of the provided objects.\r\n2. Serializers are not Closeable anymore. So caches or rather the serialization provider won't be closing the serializers when they are closed.","created_at":"2015-11-04T12:45:49Z","updated_at":"2015-11-04T12:55:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2594aee97a11d9f7235a0eee22930106136d7112","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/664/commits","review_comments_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/664/comments","review_comment_url":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ehcache/ehcache3/issues/664/comments","statuses_url":"https://api.github.com/repos/ehcache/ehcache3/statuses/966656d703aea8ece91a92ce7a7ccf989d99f737","head":{"label":"albinsuresh:issue-635-v3","ref":"issue-635-v3","sha":"966656d703aea8ece91a92ce7a7ccf989d99f737","user":{"login":"albinsuresh","id":1647963,"avatar_url":"https://avatars.githubusercontent.com/u/1647963?v=3","gravatar_id":"","url":"https://api.github.com/users/albinsuresh","html_url":"https://github.com/albinsuresh","followers_url":"https://api.github.com/users/albinsuresh/followers","following_url":"https://api.github.com/users/albinsuresh/following{/other_user}","gists_url":"https://api.github.com/users/albinsuresh/gists{/gist_id}","starred_url":"https://api.github.com/users/albinsuresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albinsuresh/subscriptions","organizations_url":"https://api.github.com/users/albinsuresh/orgs","repos_url":"https://api.github.com/users/albinsuresh/repos","events_url":"https://api.github.com/users/albinsuresh/events{/privacy}","received_events_url":"https://api.github.com/users/albinsuresh/received_events","type":"User","site_admin":false},"repo":{"id":39440089,"name":"ehcache3","full_name":"albinsuresh/ehcache3","owner":{"login":"albinsuresh","id":1647963,"avatar_url":"https://avatars.githubusercontent.com/u/1647963?v=3","gravatar_id":"","url":"https://api.github.com/users/albinsuresh","html_url":"https://github.com/albinsuresh","followers_url":"https://api.github.com/users/albinsuresh/followers","following_url":"https://api.github.com/users/albinsuresh/following{/other_user}","gists_url":"https://api.github.com/users/albinsuresh/gists{/gist_id}","starred_url":"https://api.github.com/users/albinsuresh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albinsuresh/subscriptions","organizations_url":"https://api.github.com/users/albinsuresh/orgs","repos_url":"https://api.github.com/users/albinsuresh/repos","events_url":"https://api.github.com/users/albinsuresh/events{/privacy}","received_events_url":"https://api.github.com/users/albinsuresh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/albinsuresh/ehcache3","description":"Ehcache 3.x line ","fork":true,"url":"https://api.github.com/repos/albinsuresh/ehcache3","forks_url":"https://api.github.com/repos/albinsuresh/ehcache3/forks","keys_url":"https://api.github.com/repos/albinsuresh/ehcache3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/albinsuresh/ehcache3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/albinsuresh/ehcache3/teams","hooks_url":"https://api.github.com/repos/albinsuresh/ehcache3/hooks","issue_events_url":"https://api.github.com/repos/albinsuresh/ehcache3/issues/events{/number}","events_url":"https://api.github.com/repos/albinsuresh/ehcache3/events","assignees_url":"https://api.github.com/repos/albinsuresh/ehcache3/assignees{/user}","branches_url":"https://api.github.com/repos/albinsuresh/ehcache3/branches{/branch}","tags_url":"https://api.github.com/repos/albinsuresh/ehcache3/tags","blobs_url":"https://api.github.com/repos/albinsuresh/ehcache3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/albinsuresh/ehcache3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/albinsuresh/ehcache3/git/refs{/sha}","trees_url":"https://api.github.com/repos/albinsuresh/ehcache3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/albinsuresh/ehcache3/statuses/{sha}","languages_url":"https://api.github.com/repos/albinsuresh/ehcache3/languages","stargazers_url":"https://api.github.com/repos/albinsuresh/ehcache3/stargazers","contributors_url":"https://api.github.com/repos/albinsuresh/ehcache3/contributors","subscribers_url":"https://api.github.com/repos/albinsuresh/ehcache3/subscribers","subscription_url":"https://api.github.com/repos/albinsuresh/ehcache3/subscription","commits_url":"https://api.github.com/repos/albinsuresh/ehcache3/commits{/sha}","git_commits_url":"https://api.github.com/repos/albinsuresh/ehcache3/git/commits{/sha}","comments_url":"https://api.github.com/repos/albinsuresh/ehcache3/comments{/number}","issue_comment_url":"https://api.github.com/repos/albinsuresh/ehcache3/issues/comments{/number}","contents_url":"https://api.github.com/repos/albinsuresh/ehcache3/contents/{+path}","compare_url":"https://api.github.com/repos/albinsuresh/ehcache3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/albinsuresh/ehcache3/merges","archive_url":"https://api.github.com/repos/albinsuresh/ehcache3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/albinsuresh/ehcache3/downloads","issues_url":"https://api.github.com/repos/albinsuresh/ehcache3/issues{/number}","pulls_url":"https://api.github.com/repos/albinsuresh/ehcache3/pulls{/number}","milestones_url":"https://api.github.com/repos/albinsuresh/ehcache3/milestones{/number}","notifications_url":"https://api.github.com/repos/albinsuresh/ehcache3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/albinsuresh/ehcache3/labels{/name}","releases_url":"https://api.github.com/repos/albinsuresh/ehcache3/releases{/id}","created_at":"2015-07-21T10:51:41Z","updated_at":"2015-07-21T10:51:43Z","pushed_at":"2015-11-04T12:43:54Z","git_url":"git://github.com/albinsuresh/ehcache3.git","ssh_url":"git@github.com:albinsuresh/ehcache3.git","clone_url":"https://github.com/albinsuresh/ehcache3.git","svn_url":"https://github.com/albinsuresh/ehcache3","homepage":"ehcache.org","size":4986,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ehcache:master","ref":"master","sha":"bb9c1f884754737fd689bc3174cbea2c90bf4da7","user":{"login":"ehcache","id":5504982,"avatar_url":"https://avatars.githubusercontent.com/u/5504982?v=3","gravatar_id":"","url":"https://api.github.com/users/ehcache","html_url":"https://github.com/ehcache","followers_url":"https://api.github.com/users/ehcache/followers","following_url":"https://api.github.com/users/ehcache/following{/other_user}","gists_url":"https://api.github.com/users/ehcache/gists{/gist_id}","starred_url":"https://api.github.com/users/ehcache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehcache/subscriptions","organizations_url":"https://api.github.com/users/ehcache/orgs","repos_url":"https://api.github.com/users/ehcache/repos","events_url":"https://api.github.com/users/ehcache/events{/privacy}","received_events_url":"https://api.github.com/users/ehcache/received_events","type":"Organization","site_admin":false},"repo":{"id":17224514,"name":"ehcache3","full_name":"ehcache/ehcache3","owner":{"login":"ehcache","id":5504982,"avatar_url":"https://avatars.githubusercontent.com/u/5504982?v=3","gravatar_id":"","url":"https://api.github.com/users/ehcache","html_url":"https://github.com/ehcache","followers_url":"https://api.github.com/users/ehcache/followers","following_url":"https://api.github.com/users/ehcache/following{/other_user}","gists_url":"https://api.github.com/users/ehcache/gists{/gist_id}","starred_url":"https://api.github.com/users/ehcache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ehcache/subscriptions","organizations_url":"https://api.github.com/users/ehcache/orgs","repos_url":"https://api.github.com/users/ehcache/repos","events_url":"https://api.github.com/users/ehcache/events{/privacy}","received_events_url":"https://api.github.com/users/ehcache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ehcache/ehcache3","description":"Ehcache 3.x line ","fork":false,"url":"https://api.github.com/repos/ehcache/ehcache3","forks_url":"https://api.github.com/repos/ehcache/ehcache3/forks","keys_url":"https://api.github.com/repos/ehcache/ehcache3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ehcache/ehcache3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ehcache/ehcache3/teams","hooks_url":"https://api.github.com/repos/ehcache/ehcache3/hooks","issue_events_url":"https://api.github.com/repos/ehcache/ehcache3/issues/events{/number}","events_url":"https://api.github.com/repos/ehcache/ehcache3/events","assignees_url":"https://api.github.com/repos/ehcache/ehcache3/assignees{/user}","branches_url":"https://api.github.com/repos/ehcache/ehcache3/branches{/branch}","tags_url":"https://api.github.com/repos/ehcache/ehcache3/tags","blobs_url":"https://api.github.com/repos/ehcache/ehcache3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ehcache/ehcache3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ehcache/ehcache3/git/refs{/sha}","trees_url":"https://api.github.com/repos/ehcache/ehcache3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ehcache/ehcache3/statuses/{sha}","languages_url":"https://api.github.com/repos/ehcache/ehcache3/languages","stargazers_url":"https://api.github.com/repos/ehcache/ehcache3/stargazers","contributors_url":"https://api.github.com/repos/ehcache/ehcache3/contributors","subscribers_url":"https://api.github.com/repos/ehcache/ehcache3/subscribers","subscription_url":"https://api.github.com/repos/ehcache/ehcache3/subscription","commits_url":"https://api.github.com/repos/ehcache/ehcache3/commits{/sha}","git_commits_url":"https://api.github.com/repos/ehcache/ehcache3/git/commits{/sha}","comments_url":"https://api.github.com/repos/ehcache/ehcache3/comments{/number}","issue_comment_url":"https://api.github.com/repos/ehcache/ehcache3/issues/comments{/number}","contents_url":"https://api.github.com/repos/ehcache/ehcache3/contents/{+path}","compare_url":"https://api.github.com/repos/ehcache/ehcache3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ehcache/ehcache3/merges","archive_url":"https://api.github.com/repos/ehcache/ehcache3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ehcache/ehcache3/downloads","issues_url":"https://api.github.com/repos/ehcache/ehcache3/issues{/number}","pulls_url":"https://api.github.com/repos/ehcache/ehcache3/pulls{/number}","milestones_url":"https://api.github.com/repos/ehcache/ehcache3/milestones{/number}","notifications_url":"https://api.github.com/repos/ehcache/ehcache3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ehcache/ehcache3/labels{/name}","releases_url":"https://api.github.com/repos/ehcache/ehcache3/releases{/id}","created_at":"2014-02-26T20:39:16Z","updated_at":"2015-11-03T08:07:29Z","pushed_at":"2015-11-04T12:45:50Z","git_url":"git://github.com/ehcache/ehcache3.git","ssh_url":"git@github.com:ehcache/ehcache3.git","clone_url":"https://github.com/ehcache/ehcache3.git","svn_url":"https://github.com/ehcache/ehcache3","homepage":"http://ehcache.github.io","size":10272,"stargazers_count":194,"watchers_count":194,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":129,"mirror_url":null,"open_issues_count":39,"forks":129,"open_issues":39,"watchers":194,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/664"},"html":{"href":"https://github.com/ehcache/ehcache3/pull/664"},"issue":{"href":"https://api.github.com/repos/ehcache/ehcache3/issues/664"},"comments":{"href":"https://api.github.com/repos/ehcache/ehcache3/issues/664/comments"},"review_comments":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/664/comments"},"review_comment":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ehcache/ehcache3/pulls/664/commits"},"statuses":{"href":"https://api.github.com/repos/ehcache/ehcache3/statuses/966656d703aea8ece91a92ce7a7ccf989d99f737"}}}}