{"action":"created","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/6783","repository_url":"https://api.github.com/repos/orientechnologies/orientdb","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/6783/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/6783/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/6783/events","html_url":"https://github.com/orientechnologies/orientdb/issues/6783","id":181106889,"number":6783,"title":"Object API: Updating child via parent","user":{"login":"diegomtassis","id":5831026,"avatar_url":"https://avatars.githubusercontent.com/u/5831026?v=3","gravatar_id":"","url":"https://api.github.com/users/diegomtassis","html_url":"https://github.com/diegomtassis","followers_url":"https://api.github.com/users/diegomtassis/followers","following_url":"https://api.github.com/users/diegomtassis/following{/other_user}","gists_url":"https://api.github.com/users/diegomtassis/gists{/gist_id}","starred_url":"https://api.github.com/users/diegomtassis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diegomtassis/subscriptions","organizations_url":"https://api.github.com/users/diegomtassis/orgs","repos_url":"https://api.github.com/users/diegomtassis/repos","events_url":"https://api.github.com/users/diegomtassis/events{/privacy}","received_events_url":"https://api.github.com/users/diegomtassis/received_events","type":"User","site_admin":false},"labels":[{"id":197557840,"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","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},"assignees":[{"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/88","html_url":"https://github.com/orientechnologies/orientdb/milestones/2.2.x%20(next%20hotfix)","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/milestones/88/labels","id":1768027,"number":88,"title":"2.2.x (next hotfix)","description":"","creator":{"login":"robfrank","id":413587,"avatar_url":"https://avatars.githubusercontent.com/u/413587?v=3","gravatar_id":"","url":"https://api.github.com/users/robfrank","html_url":"https://github.com/robfrank","followers_url":"https://api.github.com/users/robfrank/followers","following_url":"https://api.github.com/users/robfrank/following{/other_user}","gists_url":"https://api.github.com/users/robfrank/gists{/gist_id}","starred_url":"https://api.github.com/users/robfrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robfrank/subscriptions","organizations_url":"https://api.github.com/users/robfrank/orgs","repos_url":"https://api.github.com/users/robfrank/repos","events_url":"https://api.github.com/users/robfrank/events{/privacy}","received_events_url":"https://api.github.com/users/robfrank/received_events","type":"User","site_admin":false},"open_issues":156,"closed_issues":15,"state":"open","created_at":"2016-05-16T08:28:14Z","updated_at":"2016-11-28T14:28:35Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-10-05T09:37:48Z","updated_at":"2016-11-28T14:39:50Z","closed_at":null,"body":"## OrientDB Version, operating system, or hardware.\n- v2.2.X\n## Operating System\n- MacOSX\n- Windows\n## Expected behavior and actual behavior\n\nI think the behavior I'm going to describe is closely related to this issue:\nhttps://github.com/orientechnologies/orientdb/issues/6729.\n\nI have a very simple domain model consisting of 2 entities related via a one-to-one relationship. Entity A has a reference to entity B. The fields in both entities are @Basic, all but the reference in A to B.\n\nI have a repository service which uses OrientDB Object API to perform CRUD and list operations on the previous domain model. The repository instantiates and access a Plocal database.\n\nThis code uses OrientDB 2.1.x and is in production. Everything works fine. We have a bunch of integration tests (junit) for all the operations in the repository.\n\nNow we are trying to upgrade to OrientDB 2.2.X.\n\nFirst, we upgraded to OrientDB 2.2.10 and all the integration tests passed, but when deploy the application to tomcat we experience a problem:\n- Create an instance of A and its related B and do save A. Fine. Both A and B are stored.\n- Update a field in B and do a save in A. An OConcurrentModificationException is thrown.\n\n`Error updating job. JobID: 0e426fe2-0a8c-41e8-8455-b3c8abec5443. Cannot UPDATE the record #43:5 because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v3 your=v2)`\n\nWhat is odd is that the record is saved, so I assume OrientDB is trying to save it twice, the first time works and the second fails because obviously it has been already been saved and thus the version has been increased.\n\nWhat is even odder, when we try to to the same operation in the same record it fails again, but if we keep trying it eventually stops failing, and from that moment on it works well.\n\nI have been trying but have not been able to reproduce this behavior on an integration test, it only happens when we deploy the application in Tomcat.\n\n**Yesterday I upgraded to OrientDB 2.2.11** and now the exception is thrown **much less often**, but still happens sometimes. That's why I assume is something related to what was reported and fixed in https://github.com/orientechnologies/orientdb/issues/6729.\n"},"comment":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/comments/263287372","html_url":"https://github.com/orientechnologies/orientdb/issues/6783#issuecomment-263287372","issue_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/6783","id":263287372,"user":{"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},"created_at":"2016-11-28T14:39:50Z","updated_at":"2016-11-28T14:39:50Z","body":"hi @diegomtassis,\n\nYes if two object are linked to each other when you create them, for solve correctly the links one of them should be \"created mock\" first to generate the rid, this in 2.1.x was managed by recursion, and in 2.2.x is solved with a \"link tracking algorithm\", so yes definitly the behaviour is changed.\n\nThis is the method that solve the double linking in 2.2.x: https://github.com/orientechnologies/orientdb/blob/2.2.x/core/src/main/java/com/orientechnologies/orient/core/tx/OTransactionNoTx.java#L202\n\nby the way the double save in 2.2.x is used only in case of notTx, for the Tx cases we have a internal rid allocation on commit phase that not need the double save.\nHope this help to find the source of the problem.\n\nRegards"}}
{"actor":{"display_login":"tglman"}}