{"action":"opened","issue":{"url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/495","repository_url":"https://api.github.com/repos/fsprojects/SQLProvider","labels_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/495/labels{/name}","comments_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/495/comments","events_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/495/events","html_url":"https://github.com/fsprojects/SQLProvider/issues/495","id":278032838,"number":495,"title":"I can't insert a row in a Postgresql table. I get a \"Enlisting in Ambiant transactions is not supported yet\"","user":{"login":"tforkmann","id":4168951,"avatar_url":"https://avatars0.githubusercontent.com/u/4168951?v=4","gravatar_id":"","url":"https://api.github.com/users/tforkmann","html_url":"https://github.com/tforkmann","followers_url":"https://api.github.com/users/tforkmann/followers","following_url":"https://api.github.com/users/tforkmann/following{/other_user}","gists_url":"https://api.github.com/users/tforkmann/gists{/gist_id}","starred_url":"https://api.github.com/users/tforkmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tforkmann/subscriptions","organizations_url":"https://api.github.com/users/tforkmann/orgs","repos_url":"https://api.github.com/users/tforkmann/repos","events_url":"https://api.github.com/users/tforkmann/events{/privacy}","received_events_url":"https://api.github.com/users/tforkmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-30T08:17:14Z","updated_at":"2017-11-30T08:17:14Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Description\r\nI can't insert a row in a sql table on ASP.NetCore 2.0\r\n\r\n### Repro steps\r\n\r\n1. Get a data context\r\n2. Opening a TransactionScope\r\n3. Submit changes\r\n\r\nLike this:\r\n\r\nlet saveReportdefinitiion (report:Reportdefinition) = \r\n    try\r\n        let dc = sql.GetDataContext()\r\n        use ts = new TransactionScope()\r\n        let newReport = dc.Dbo.Berichtsdefinitionen.Create ()\r\n        newReport.BerichtsId <- report.Berichtsid\r\n        newReport.Berichtsname <- Some report.Berichtsname\r\n        ...\r\n\r\n        dc.SubmitUpdates()\r\n        ts.Dispose()\r\n    finally\r\n        GC.Collect()\r\n    report\r\n\r\n### Expected behavior\r\n\r\nI expect the framework to insert a row in the database.\r\n\r\n### Actual behavior\r\n\r\nI get this error:\r\n\r\nAn unhandled exception has occurred while executing the request.                             System.NotSupportedException: Enlisting in Ambient transactions is not supported.\r\n   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)\r\n   at System.Data.SqlClient.SqlConnection.Open()\r\n   at FSharp.Data.Sql.Providers.MSSqlServerProvider.FSharp-Data-Sql-Common-ISqlProvider-GetColumns(IDbConnection con, Table table)                                                                       at FSharp.Data.Sql.Runtime.SqlDataContext.FSharp-Data-Sql-Common-ISqlDataContext-CreateEntity(String tableName)                                                                                       at EnergyDashboard.BackEnd.Common.Crudsql.createReport(Reportdefinition report, Object dc)\r\n\r\n### Related information \r\n\r\n* Used database: sql server 2008 rs2\r\n* Operating system: Windows 10\r\n* SQL Provider 1.1.23\r\n* ASP.NetCore 2.0 using Giraffe\r\n"}}
{"actor":{"display_login":"tforkmann"}}