{"action":"created","issue":{"url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/2877","repository_url":"https://api.github.com/repos/OrchardCMS/OrchardCore","labels_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/2877/labels{/name}","comments_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/2877/comments","events_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/2877/events","html_url":"https://github.com/OrchardCMS/OrchardCore/pull/2877","id":391590646,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5MDUxNjQ5","number":2877,"title":"Some Fixes to DbConnectionAccessor with Documentation Updates.","user":{"login":"mdockal","id":26497457,"node_id":"MDQ6VXNlcjI2NDk3NDU3","avatar_url":"https://avatars0.githubusercontent.com/u/26497457?v=4","gravatar_id":"","url":"https://api.github.com/users/mdockal","html_url":"https://github.com/mdockal","followers_url":"https://api.github.com/users/mdockal/followers","following_url":"https://api.github.com/users/mdockal/following{/other_user}","gists_url":"https://api.github.com/users/mdockal/gists{/gist_id}","starred_url":"https://api.github.com/users/mdockal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdockal/subscriptions","organizations_url":"https://api.github.com/users/mdockal/orgs","repos_url":"https://api.github.com/users/mdockal/repos","events_url":"https://api.github.com/users/mdockal/events{/privacy}","received_events_url":"https://api.github.com/users/mdockal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-17T07:39:26Z","updated_at":"2018-12-17T09:41:38Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/OrchardCMS/OrchardCore/pulls/2877","html_url":"https://github.com/OrchardCMS/OrchardCore/pull/2877","diff_url":"https://github.com/OrchardCMS/OrchardCore/pull/2877.diff","patch_url":"https://github.com/OrchardCMS/OrchardCore/pull/2877.patch"},"body":"I ran into some weird issues with Orchard Core this weekend.  I tried saving updates to pages and I couldn't do that.  I tried adding new users and that also failed.  It seemed like every time I tried to save something to the database it failed.   I was also using `DbConnectionAccessor.GetConnectionAsync()' to write data to the database.  I wondered if this new class was causing some issues so I commented it out where it was registered in debug and everything started working again like it was supposed to.    So I uncommented it and injected it into OrchardCore.Users module to see what was happening.   I eventually got and exception that the connection was null when it was trying to dispose.  I think maybe this was what was causing problems because I wasn't getting an exception when I was doing it via the nuget packages.   I also wanted to see where else the DbConnectionAccessor was being used and I found where it wasn't being disposed in ShellDescriptorManager.   The connection wasn't being closed either.\r\n\r\nI think the following changes will remedy the situation:\r\n\r\n- Fixed issue with DbConnectionAccessor throwing exception when disposed because the connection was null.  \r\n- Wrapped DbConnectionAccessor in using block in ShellDescriptorManager so it is disposed.\r\n- Created Readme.md for DbConnectionAccessor in OrchardCore.Data"},"comment":{"url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/comments/447781179","html_url":"https://github.com/OrchardCMS/OrchardCore/pull/2877#issuecomment-447781179","issue_url":"https://api.github.com/repos/OrchardCMS/OrchardCore/issues/2877","id":447781179,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Nzc4MTE3OQ==","user":{"login":"mdockal","id":26497457,"node_id":"MDQ6VXNlcjI2NDk3NDU3","avatar_url":"https://avatars0.githubusercontent.com/u/26497457?v=4","gravatar_id":"","url":"https://api.github.com/users/mdockal","html_url":"https://github.com/mdockal","followers_url":"https://api.github.com/users/mdockal/followers","following_url":"https://api.github.com/users/mdockal/following{/other_user}","gists_url":"https://api.github.com/users/mdockal/gists{/gist_id}","starred_url":"https://api.github.com/users/mdockal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdockal/subscriptions","organizations_url":"https://api.github.com/users/mdockal/orgs","repos_url":"https://api.github.com/users/mdockal/repos","events_url":"https://api.github.com/users/mdockal/events{/privacy}","received_events_url":"https://api.github.com/users/mdockal/received_events","type":"User","site_admin":false},"created_at":"2018-12-17T09:41:38Z","updated_at":"2018-12-17T09:41:38Z","author_association":"CONTRIBUTOR","body":"Well maybe I shouldn't have changed the IndexingTaskManager but then again maybe this is why I am having weird issues.  \r\n\r\nThe reason the builds failed was 6 of the tests failed on Appveyor:\r\n`System.AggregateException : One or more errors occurred. (SQLite Error 6: 'database table is locked'.)\r\n---- Microsoft.Data.Sqlite.SqliteException : SQLite Error 6: 'database table is locked'.`\r\n\r\nDitto on Travis CI..."}}
{"actor":{"display_login":"mdockal"}}