{"action":"closed","issue":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2218","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2218/labels{/name}","comments_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2218/comments","events_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2218/events","html_url":"https://github.com/Starcounter/Starcounter/issues/2218","id":40048016,"number":2218,"title":"Implicit write transactions","user":{"login":"Starcounter-Jack","id":1219049,"avatar_url":"https://avatars.githubusercontent.com/u/1219049?v=3","gravatar_id":"","url":"https://api.github.com/users/Starcounter-Jack","html_url":"https://github.com/Starcounter-Jack","followers_url":"https://api.github.com/users/Starcounter-Jack/followers","following_url":"https://api.github.com/users/Starcounter-Jack/following{/other_user}","gists_url":"https://api.github.com/users/Starcounter-Jack/gists{/gist_id}","starred_url":"https://api.github.com/users/Starcounter-Jack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starcounter-Jack/subscriptions","organizations_url":"https://api.github.com/users/Starcounter-Jack/orgs","repos_url":"https://api.github.com/users/Starcounter-Jack/repos","events_url":"https://api.github.com/users/Starcounter-Jack/events{/privacy}","received_events_url":"https://api.github.com/users/Starcounter-Jack/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/San+Jose","name":"San Jose","color":"e11d21"}],"state":"closed","locked":false,"assignee":{"login":"chrhol","id":1658979,"avatar_url":"https://avatars.githubusercontent.com/u/1658979?v=3","gravatar_id":"","url":"https://api.github.com/users/chrhol","html_url":"https://github.com/chrhol","followers_url":"https://api.github.com/users/chrhol/followers","following_url":"https://api.github.com/users/chrhol/following{/other_user}","gists_url":"https://api.github.com/users/chrhol/gists{/gist_id}","starred_url":"https://api.github.com/users/chrhol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrhol/subscriptions","organizations_url":"https://api.github.com/users/chrhol/orgs","repos_url":"https://api.github.com/users/chrhol/repos","events_url":"https://api.github.com/users/chrhol/events{/privacy}","received_events_url":"https://api.github.com/users/chrhol/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Starcounter/Starcounter/milestones/51","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/milestones/51/labels","id":602455,"number":51,"title":"v2.0","description":"","creator":{"login":"Starcounter-Jack","id":1219049,"avatar_url":"https://avatars.githubusercontent.com/u/1219049?v=3","gravatar_id":"","url":"https://api.github.com/users/Starcounter-Jack","html_url":"https://github.com/Starcounter-Jack","followers_url":"https://api.github.com/users/Starcounter-Jack/followers","following_url":"https://api.github.com/users/Starcounter-Jack/following{/other_user}","gists_url":"https://api.github.com/users/Starcounter-Jack/gists{/gist_id}","starred_url":"https://api.github.com/users/Starcounter-Jack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Starcounter-Jack/subscriptions","organizations_url":"https://api.github.com/users/Starcounter-Jack/orgs","repos_url":"https://api.github.com/users/Starcounter-Jack/repos","events_url":"https://api.github.com/users/Starcounter-Jack/events{/privacy}","received_events_url":"https://api.github.com/users/Starcounter-Jack/received_events","type":"User","site_admin":false},"open_issues":341,"closed_issues":273,"state":"open","created_at":"2014-03-19T09:04:00Z","updated_at":"2015-01-15T16:25:24Z","due_on":null,"closed_at":null},"comments":33,"created_at":"2014-08-12T12:00:07Z","updated_at":"2015-01-15T16:25:24Z","closed_at":"2015-01-15T16:25:24Z","body":"This is a separation of the implicit transaction feature in #1852.\r\n\r\nSome tests. Start with the third one as I suspect this is where we will find out if the implementation is correct. I.e. p1 should be visible to all nested scopes.\r\n\r\n```c#\r\nstatic void Main() {\r\n    var p1 = new Person() { Name = \"p1\" };\r\n    // p1 should be visible here but not globally. test with administrator while blocking.\r\n    Block(1000000);\r\n    // After returning from this task, p1 should be globally visible. \r\n}\r\n```\r\n\r\n```c#\r\nstatic void Main() {\r\n    Db.Transaction( () => {\r\n        var p1 = new Person() { Name = \"p1\" };\r\n    });\r\n    // p1 should be globally visible. test from administrator\r\n    Block(100000);\r\n    Db.Transaction( () => {\r\n        var p2 = new Person() { Name = \"p2\" };\r\n        throw new TransactionFailed();\r\n    });\r\n    // p1 should be globally visible while p2 should not. test from administrator while blocking\r\n    Block(100000);\r\n}\r\n```\r\n\r\n\r\n```c#\r\nstatic void Main() {\r\n    var p1 = new Person() { Name = \"p1\" };    \r\n    Db.Transaction( () => {\r\n       var p1test1 = Db.SQL(\"SELECT FROM Person P WHERE Name=?\", p1 ).First;\r\n        Console.WriteLine(p1test1);\r\n       // p1 should be locally visible here but not globally visible\r\n        var p2 = new Person() { Name = \"p3\" };\r\n    });\r\n    Db.Transaction( () => {\r\n        var p1test2 = Db.SQL(\"SELECT FROM Person P WHERE Name=?\", p1 ).First;\r\n        Console.WriteLine(p1test2);\r\n       // p1 should be locally visible here but not globally visible\r\n        var p3 = new Person() { Name = \"p3\" };\r\n        throw new TransactionFailed();\r\n    });\r\n}\r\n```"}}