{"action":"opened","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/7646","repository_url":"https://api.github.com/repos/orientechnologies/orientdb","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/7646/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/7646/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/7646/events","html_url":"https://github.com/orientechnologies/orientdb/issues/7646","id":249371829,"number":7646,"title":"Under some conditions 50% transactions are not being commited","user":{"login":"PhantomYdn","id":1199285,"avatar_url":"https://avatars1.githubusercontent.com/u/1199285?v=4","gravatar_id":"","url":"https://api.github.com/users/PhantomYdn","html_url":"https://github.com/PhantomYdn","followers_url":"https://api.github.com/users/PhantomYdn/followers","following_url":"https://api.github.com/users/PhantomYdn/following{/other_user}","gists_url":"https://api.github.com/users/PhantomYdn/gists{/gist_id}","starred_url":"https://api.github.com/users/PhantomYdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhantomYdn/subscriptions","organizations_url":"https://api.github.com/users/PhantomYdn/orgs","repos_url":"https://api.github.com/users/PhantomYdn/repos","events_url":"https://api.github.com/users/PhantomYdn/events{/privacy}","received_events_url":"https://api.github.com/users/PhantomYdn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-10T14:46:40Z","updated_at":"2017-08-10T14:46:40Z","closed_at":null,"body":"### OrientDB Version: 2.2.25\r\n### Java Version: 8+ \r\n### OS: ubuntu\r\n\r\n2 days I was catching very tricky bug. In Orienteer it looked like the following: on some document in half cases data was not being saved at all. Looks like a magic, right?:)\r\n\r\nAfter investigation we found the following:\r\nDuring saving of document there are 2 records added through OTransactionOptimistic.addRecord(). One for old document and one for updated. And order is unpredictable, so last wins. \r\nDigging deeper we found quite interesting stuff: ODirtyManager.merge() and this method is merging those old record and new record.\r\n\r\nAnd here 2 facts leads to mentioned results:\r\n1) We are using ODocument as container for fields with type EMBEDDED. And this document is serialized between requests till being saved within parent document \r\n2) ODocument.dirtyManager is not transient - so it's serialized between calls.\r\n\r\nAfter adding `ORecordInternal.setDirtyManager(doc, null)` before serialization issue is gone.\r\n\r\nProposal: **please make `ODocument.dirtyManager` transient. I  don't see any good reason to keep it as is.**"}}
{"actor":{"display_login":"PhantomYdn"}}