{"action":"created","issue":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4311","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4311/labels{/name}","comments_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4311/comments","events_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4311/events","html_url":"https://github.com/orientechnologies/orientdb/issues/4311","id":85636177,"number":4311,"title":"Sub transactions commit/rollback outer ones with in-memory DB","user":{"login":"mohamnag","id":4481421,"avatar_url":"https://avatars.githubusercontent.com/u/4481421?v=3","gravatar_id":"","url":"https://api.github.com/users/mohamnag","html_url":"https://github.com/mohamnag","followers_url":"https://api.github.com/users/mohamnag/followers","following_url":"https://api.github.com/users/mohamnag/following{/other_user}","gists_url":"https://api.github.com/users/mohamnag/gists{/gist_id}","starred_url":"https://api.github.com/users/mohamnag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohamnag/subscriptions","organizations_url":"https://api.github.com/users/mohamnag/orgs","repos_url":"https://api.github.com/users/mohamnag/repos","events_url":"https://api.github.com/users/mohamnag/events{/privacy}","received_events_url":"https://api.github.com/users/mohamnag/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/invalid","name":"invalid","color":"e6e6e6"},{"url":"https://api.github.com/repos/orientechnologies/orientdb/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"closed","locked":false,"assignee":{"login":"laa","id":105066,"avatar_url":"https://avatars.githubusercontent.com/u/105066?v=3","gravatar_id":"","url":"https://api.github.com/users/laa","html_url":"https://github.com/laa","followers_url":"https://api.github.com/users/laa/followers","following_url":"https://api.github.com/users/laa/following{/other_user}","gists_url":"https://api.github.com/users/laa/gists{/gist_id}","starred_url":"https://api.github.com/users/laa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laa/subscriptions","organizations_url":"https://api.github.com/users/laa/orgs","repos_url":"https://api.github.com/users/laa/repos","events_url":"https://api.github.com/users/laa/events{/privacy}","received_events_url":"https://api.github.com/users/laa/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/orientechnologies/orientdb/milestones/54","html_url":"https://github.com/orientechnologies/orientdb/milestones/2.1-rc4","labels_url":"https://api.github.com/repos/orientechnologies/orientdb/milestones/54/labels","id":1167569,"number":54,"title":"2.1-rc4","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":2,"closed_issues":45,"state":"open","created_at":"2015-06-16T21:19:23Z","updated_at":"2015-06-16T21:22:12Z","due_on":"2015-06-16T22:00:00Z","closed_at":null},"comments":4,"created_at":"2015-06-05T21:23:57Z","updated_at":"2015-06-17T06:55:01Z","closed_at":"2015-06-16T16:58:55Z","body":"Following code should start a sub-transaction inside an outer transaction. \r\n\r\n```java\r\nimport com.tinkerpop.blueprints.impls.orient.OrientGraph;\r\nimport com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;\r\nimport com.tinkerpop.blueprints.impls.orient.OrientVertex;\r\n\r\n/**\r\n * Created by mohamnag on 03/06/15.\r\n */\r\npublic class test {\r\n\r\n    private static OrientGraphFactory graphFactory = new OrientGraphFactory(\"memory:testdb\", \"admin\", \"admin\");\r\n\r\n    public static void main(String[] args) {\r\n\r\n        OrientGraph graph = graphFactory.getTx();\r\n\r\n        graph.executeOutsideTx(noTx -> {\r\n            noTx.createVertexType(\"test\");\r\n            return null;\r\n        });\r\n\r\n        OrientVertex vertex = graph.addVertex(\"class:test\");\r\n\r\n        //<<<<<< this is a call to another function which does somethings in a sub-transaction\r\n\r\n        OrientGraph graph2 = graphFactory.getTx();\r\n\r\n        OrientVertex vertex2 = graph2.addVertex(\"class:test\");\r\n        // do something with vertex2, set properties\r\n        graph2.commit();\r\n\r\n        //>>>>>> here we return to original function\r\n\r\n        // now we continue own business in outer transaction\r\n        vertex.setProperty(\"test\", \"value\");\r\n\r\n        graph.commit();\r\n    }\r\n\r\n}\r\n```\r\n\r\nThis works as expected while using orientdb v2.0.10 as remote database and v2.0.8 as in-memory database, however when using v2.0.9 or 2.0.10 as in-memory database, following exception is thrown:\r\n\r\n```\r\nException in thread \"main\" java.lang.IllegalStateException: The vertex #11:-2 has been deleted\r\n\tat com.tinkerpop.blueprints.impls.orient.OrientElement.setProperty(OrientElement.java:177)\r\n\tat test.main(test.java:26)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)\r\n```"},"comment":{"url":"https://api.github.com/repos/orientechnologies/orientdb/issues/comments/112680343","html_url":"https://github.com/orientechnologies/orientdb/issues/4311#issuecomment-112680343","issue_url":"https://api.github.com/repos/orientechnologies/orientdb/issues/4311","id":112680343,"user":{"login":"mohamnag","id":4481421,"avatar_url":"https://avatars.githubusercontent.com/u/4481421?v=3","gravatar_id":"","url":"https://api.github.com/users/mohamnag","html_url":"https://github.com/mohamnag","followers_url":"https://api.github.com/users/mohamnag/followers","following_url":"https://api.github.com/users/mohamnag/following{/other_user}","gists_url":"https://api.github.com/users/mohamnag/gists{/gist_id}","starred_url":"https://api.github.com/users/mohamnag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohamnag/subscriptions","organizations_url":"https://api.github.com/users/mohamnag/orgs","repos_url":"https://api.github.com/users/mohamnag/repos","events_url":"https://api.github.com/users/mohamnag/events{/privacy}","received_events_url":"https://api.github.com/users/mohamnag/received_events","type":"User","site_admin":false},"created_at":"2015-06-17T06:55:01Z","updated_at":"2015-06-17T06:55:01Z","body":"I'm going to test it now, it may take a while for all the tests to run but I will post an update here as soon as I have the results"}}