{"action":"created","issue":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6832","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6832/labels{/name}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6832/comments","events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6832/events","html_url":"https://github.com/hazelcast/hazelcast/issues/6832","id":118394384,"number":6832,"title":"Accessing a destroyed proxy implicitly creates a map, but does not register the proxy","user":{"login":"cangencer","id":510278,"avatar_url":"https://avatars.githubusercontent.com/u/510278?v=3","gravatar_id":"","url":"https://api.github.com/users/cangencer","html_url":"https://github.com/cangencer","followers_url":"https://api.github.com/users/cangencer/followers","following_url":"https://api.github.com/users/cangencer/following{/other_user}","gists_url":"https://api.github.com/users/cangencer/gists{/gist_id}","starred_url":"https://api.github.com/users/cangencer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cangencer/subscriptions","organizations_url":"https://api.github.com/users/cangencer/orgs","repos_url":"https://api.github.com/users/cangencer/repos","events_url":"https://api.github.com/users/cangencer/events{/privacy}","received_events_url":"https://api.github.com/users/cangencer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Team:%20Client","name":"Team: Client","color":"8f77cc"},{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Team:%20Core","name":"Team: Core","color":"109def"},{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Type:%20Defect","name":"Type: Defect","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/70","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.7","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/70/labels","id":1346433,"number":70,"title":"3.7","description":"","creator":{"login":"pveentjer","id":105243,"avatar_url":"https://avatars.githubusercontent.com/u/105243?v=3","gravatar_id":"","url":"https://api.github.com/users/pveentjer","html_url":"https://github.com/pveentjer","followers_url":"https://api.github.com/users/pveentjer/followers","following_url":"https://api.github.com/users/pveentjer/following{/other_user}","gists_url":"https://api.github.com/users/pveentjer/gists{/gist_id}","starred_url":"https://api.github.com/users/pveentjer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pveentjer/subscriptions","organizations_url":"https://api.github.com/users/pveentjer/orgs","repos_url":"https://api.github.com/users/pveentjer/repos","events_url":"https://api.github.com/users/pveentjer/events{/privacy}","received_events_url":"https://api.github.com/users/pveentjer/received_events","type":"User","site_admin":false},"open_issues":128,"closed_issues":4,"state":"open","created_at":"2015-10-09T12:16:13Z","updated_at":"2015-12-10T12:56:05Z","due_on":"2016-02-29T22:00:00Z","closed_at":null},"comments":2,"created_at":"2015-11-23T14:38:49Z","updated_at":"2015-12-13T04:04:56Z","closed_at":null,"body":"After destroying a proxy, accessing the map again implicitly creates a new map, but it looks like there are no proxies registered for the map. \r\n\r\nEither there should be an exception thrown when accessing a destroyed proxy or if it is accessed again, it should be re-registered in the ProxyService. The same issue occurs with a client side proxy as well.\r\n ```\r\n   @Test\r\n    public void testDistributedObjects() throws InterruptedException {\r\n        HazelcastInstance hazelcastInstance = hazelcastFactory.newHazelcastInstance();\r\n        IMap map = hazelcastInstance.getMap(\"map\");\r\n        assertEquals(1, hazelcastInstance.getDistributedObjects().size());\r\n\r\n        map.destroy();\r\n        assertEquals(0, hazelcastInstance.getDistributedObjects().size());\r\n\r\n        map.put(\"foo\", \"bar\");\r\n        assertEquals(\"bar\", map.get(\"foo\"));\r\n        assertEquals(1, hazelcastInstance.getDistributedObjects().size());\r\n    }\r\n```\r\n\r\nThis is also related to #4714"},"comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments/164219495","html_url":"https://github.com/hazelcast/hazelcast/issues/6832#issuecomment-164219495","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6832","id":164219495,"user":{"login":"a-reisberg","id":16026762,"avatar_url":"https://avatars.githubusercontent.com/u/16026762?v=3","gravatar_id":"","url":"https://api.github.com/users/a-reisberg","html_url":"https://github.com/a-reisberg","followers_url":"https://api.github.com/users/a-reisberg/followers","following_url":"https://api.github.com/users/a-reisberg/following{/other_user}","gists_url":"https://api.github.com/users/a-reisberg/gists{/gist_id}","starred_url":"https://api.github.com/users/a-reisberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-reisberg/subscriptions","organizations_url":"https://api.github.com/users/a-reisberg/orgs","repos_url":"https://api.github.com/users/a-reisberg/repos","events_url":"https://api.github.com/users/a-reisberg/events{/privacy}","received_events_url":"https://api.github.com/users/a-reisberg/received_events","type":"User","site_admin":false},"created_at":"2015-12-13T04:04:56Z","updated_at":"2015-12-13T04:04:56Z","body":"+1\r\n\r\nI've recently been having troubles with the same issue. I would like to propose a small api change: `getMap` and `createMap`:\r\n- `getMap` will only return a map object if it already exists.\r\n- `createMap` will either return a map if it already exists, or create a new one if it doesn't exist.\r\n\r\nMaybe some other variant of this would be fine as well, as long as we can make sure that there's nothing that accidentally gets created."}}