{"action":"created","issue":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3169","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3169/labels{/name}","comments_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3169/comments","events_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3169/events","html_url":"https://github.com/Starcounter/Starcounter/issues/3169","id":121481437,"number":3169,"title":"Transaction.Current is null","user":{"login":"careri","id":4263597,"avatar_url":"https://avatars.githubusercontent.com/u/4263597?v=3","gravatar_id":"","url":"https://api.github.com/users/careri","html_url":"https://github.com/careri","followers_url":"https://api.github.com/users/careri/followers","following_url":"https://api.github.com/users/careri/following{/other_user}","gists_url":"https://api.github.com/users/careri/gists{/gist_id}","starred_url":"https://api.github.com/users/careri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/careri/subscriptions","organizations_url":"https://api.github.com/users/careri/orgs","repos_url":"https://api.github.com/users/careri/repos","events_url":"https://api.github.com/users/careri/events{/privacy}","received_events_url":"https://api.github.com/users/careri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-10T13:15:55Z","updated_at":"2015-12-10T13:31:43Z","closed_at":null,"body":"How do I commit the current transaction?\r\nIn the code below m_factory will make another call to Db.Transact, creating a nested transaction on another thread. But then when I return to ```Transaction.Current.Commit();``` Current is null. Is that as intended?\r\n\r\n```\r\ninternal void Execute()\r\n            {\r\n                // Create a light weight transaction. \r\n                Db.Transact(Commit);\r\n            }\r\n\r\n            private void Commit()\r\n            {\r\n                try\r\n                {\r\n                    Result = m_factory();\r\n                    Transaction.Current.Commit();\r\n                    State = Status.Processed;\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                    s_logger.Error(ex, \"Unhandled exception in MQScheduler\");\r\n                    State = Status.Failed;\r\n                }\r\n                finally\r\n                {\r\n                    m_done.Set();\r\n                }\r\n            }\r\n```"},"comment":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/comments/163617778","html_url":"https://github.com/Starcounter/Starcounter/issues/3169#issuecomment-163617778","issue_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/3169","id":163617778,"user":{"login":"careri","id":4263597,"avatar_url":"https://avatars.githubusercontent.com/u/4263597?v=3","gravatar_id":"","url":"https://api.github.com/users/careri","html_url":"https://github.com/careri","followers_url":"https://api.github.com/users/careri/followers","following_url":"https://api.github.com/users/careri/following{/other_user}","gists_url":"https://api.github.com/users/careri/gists{/gist_id}","starred_url":"https://api.github.com/users/careri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/careri/subscriptions","organizations_url":"https://api.github.com/users/careri/orgs","repos_url":"https://api.github.com/users/careri/repos","events_url":"https://api.github.com/users/careri/events{/privacy}","received_events_url":"https://api.github.com/users/careri/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T13:31:43Z","updated_at":"2015-12-10T13:31:43Z","body":"Yeah, just added some debug code where I noticed Transaction.Current is never set.\r\nThanks"}}