{"action":"opened","issue":{"url":"https://api.github.com/repos/ttddyy/datasource-proxy/issues/26","repository_url":"https://api.github.com/repos/ttddyy/datasource-proxy","labels_url":"https://api.github.com/repos/ttddyy/datasource-proxy/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/ttddyy/datasource-proxy/issues/26/comments","events_url":"https://api.github.com/repos/ttddyy/datasource-proxy/issues/26/events","html_url":"https://github.com/ttddyy/datasource-proxy/issues/26","id":194066228,"number":26,"title":"Listeners, ExecutionInfo reference consistency between before and after calls","user":{"login":"vokinpirks","id":17597433,"avatar_url":"https://avatars.githubusercontent.com/u/17597433?v=3","gravatar_id":"","url":"https://api.github.com/users/vokinpirks","html_url":"https://github.com/vokinpirks","followers_url":"https://api.github.com/users/vokinpirks/followers","following_url":"https://api.github.com/users/vokinpirks/following{/other_user}","gists_url":"https://api.github.com/users/vokinpirks/gists{/gist_id}","starred_url":"https://api.github.com/users/vokinpirks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vokinpirks/subscriptions","organizations_url":"https://api.github.com/users/vokinpirks/orgs","repos_url":"https://api.github.com/users/vokinpirks/repos","events_url":"https://api.github.com/users/vokinpirks/events{/privacy}","received_events_url":"https://api.github.com/users/vokinpirks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-07T14:39:02Z","updated_at":"2016-12-07T14:39:02Z","closed_at":null,"body":"Hello!\r\nThx for this very helpful library.\r\n\r\nI tried to implement some simple detect hanging queries listener, based on ConcurrentHashMap<ExecutionInfo, Long> containing currently executing queries where values are just query execution start time.\r\nIn beforeQuery method register ExecutionInfo and query's execution start time and then in afterQuery I  try to deregister it. But in afterQuery map is unable to find corresponding ExecutionInfo because it is new instance.\r\n\r\nCode from net.ttddyy.dsproxy.proxy.PreparedStatementProxyLogic:\r\n\r\n        listener.beforeQuery(**new ExecutionInfo(dataSourceName, this.ps, isBatchExecution, batchSize, method, args)**, queries);\r\n\r\n        // Invoke method on original Statement.\r\n        final ExecutionInfo execInfo = new ExecutionInfo(dataSourceName, this.ps, isBatchExecution, batchSize, method, args);\r\n\r\nAs you can see two fully identical ExecutionInfo objects are instantiated here. Maybe it would be better to create ExecutionInfo instance just once and then reuse it?"}}
{"actor":{"display_login":"vokinpirks"}}