{"action":"created","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4192","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4192/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4192/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4192/events","html_url":"https://github.com/orientechnologies/orientdb/issues/4192","id":78710515,"number":4192,"title":"Incorrect DB hook dirty field in case of concurrent modification","user":{"login":"ylopotun","id":6156970,"avatar_url":"https://avatars.githubusercontent.com/u/6156970?v=3","gravatar_id":"","url":"https://api.github.com/users/ylopotun","html_url":"https://github.com/ylopotun","followers_url":"https://api.github.com/users/ylopotun/followers","following_url":"https://api.github.com/users/ylopotun/following{/other_user}","gists_url":"https://api.github.com/users/ylopotun/gists{/gist_id}","starred_url":"https://api.github.com/users/ylopotun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ylopotun/subscriptions","organizations_url":"https://api.github.com/users/ylopotun/orgs","repos_url":"https://api.github.com/users/ylopotun/repos","events_url":"https://api.github.com/users/ylopotun/events{/privacy}","received_events_url":"https://api.github.com/users/ylopotun/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/bug","name":"bug","color":"ededed"},{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/waiting%20reply","name":"waiting reply","color":"eb6420"}],"state":"closed","locked":false,"assignee":{"login":"tglman","id":424369,"avatar_url":"https://avatars.githubusercontent.com/u/424369?v=3","gravatar_id":"","url":"https://api.github.com/users/tglman","html_url":"https://github.com/tglman","followers_url":"https://api.github.com/users/tglman/followers","following_url":"https://api.github.com/users/tglman/following{/other_user}","gists_url":"https://api.github.com/users/tglman/gists{/gist_id}","starred_url":"https://api.github.com/users/tglman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tglman/subscriptions","organizations_url":"https://api.github.com/users/tglman/orgs","repos_url":"https://api.github.com/users/tglman/repos","events_url":"https://api.github.com/users/tglman/events{/privacy}","received_events_url":"https://api.github.com/users/tglman/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/orientechnologies/orientdb/milestones/17","html_url":"https://github.com/orientechnologies/orientdb/milestones/2.2","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/milestones/17/labels","id":613160,"number":17,"title":"2.2","description":"","creator":{"login":"lvca","id":312606,"avatar_url":"https://avatars.githubusercontent.com/u/312606?v=3","gravatar_id":"","url":"https://api.github.com/users/lvca","html_url":"https://github.com/lvca","followers_url":"https://api.github.com/users/lvca/followers","following_url":"https://api.github.com/users/lvca/following{/other_user}","gists_url":"https://api.github.com/users/lvca/gists{/gist_id}","starred_url":"https://api.github.com/users/lvca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvca/subscriptions","organizations_url":"https://api.github.com/users/lvca/orgs","repos_url":"https://api.github.com/users/lvca/repos","events_url":"https://api.github.com/users/lvca/events{/privacy}","received_events_url":"https://api.github.com/users/lvca/received_events","type":"User","site_admin":false},"open_issues":236,"closed_issues":83,"state":"open","created_at":"2014-03-28T13:17:36Z","updated_at":"2015-10-07T11:43:12Z","due_on":"2015-10-06T22:00:00Z","closed_at":null},"comments":4,"created_at":"2015-05-20T21:45:37Z","updated_at":"2015-10-07T11:43:12Z","closed_at":"2015-10-07T11:43:12Z","body":"We encountered a DB hook-related issue. When we try to set a vertex property via remote connection and the vertex object is not of the latest version, the DB hook’s dirty fields list mistakenly contains the property that was changed in between the current object’s version and the latest, although it wasn’t meant to be changed in the current operation. \nSee the attached unit test for better understanding.\nFor better understanding, consider the following example:\n1) Thread 1 (plocal connection) created Vertex 1 and sets its “name” property value to “name1”\n2) Thread 2 (remote connection) loads Vertex 1\n3) Thread 1 updates Vertex 1 “name” property value to “name2”\n4) Thread 2 tries to set Vertex 1 “description” property value to “description1”. The operation fails with OConcurrentModificationExcpetion, but the DB Hook gets fired indicating the change of 2 property values:\n“name” – from “name2” to “name1” (which is incorrect – this property value was not meant to be changed)\n“description” – from null to “description1”\n5) Thread 2 reloads Vertex 1 and retries setting its “description” property value to “description1”. This time operation succeeds. The DB Hook gets fired indicating the change of 1 property value:\n“description” – from null to “description1”\n\nThis results in the modules that rely on DB notifications to have the wrong value of the “name” property.\nSo, either in step 4 the DB Hook should not notify about “name” property value change to the previous one or in step 5 it should again notify about “name” property value change, this time to the current one."},"comment":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/comments/146165572","html_url":"https://github.com/orientechnologies/orientdb/issues/4192#issuecomment-146165572","issue_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4192","id":146165572,"user":{"login":"prjhub","id":11502046,"avatar_url":"https://avatars.githubusercontent.com/u/11502046?v=3","gravatar_id":"","url":"https://api.github.com/users/prjhub","html_url":"https://github.com/prjhub","followers_url":"https://api.github.com/users/prjhub/followers","following_url":"https://api.github.com/users/prjhub/following{/other_user}","gists_url":"https://api.github.com/users/prjhub/gists{/gist_id}","starred_url":"https://api.github.com/users/prjhub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prjhub/subscriptions","organizations_url":"https://api.github.com/users/prjhub/orgs","repos_url":"https://api.github.com/users/prjhub/repos","events_url":"https://api.github.com/users/prjhub/events{/privacy}","received_events_url":"https://api.github.com/users/prjhub/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T11:43:12Z","updated_at":"2015-10-07T11:43:12Z","body":"The issue has been closed because no response has been received after a while. In case the issue is still valid, please reopen it or write a comment that explains why it's still valid and a way to reproduce it. Thank you."}}