{"action":"created","issue":{"url":"https://api.github.com/repos/linq2db/linq2db/issues/1471","repository_url":"https://api.github.com/repos/linq2db/linq2db","labels_url":"https://api.github.com/repos/linq2db/linq2db/issues/1471/labels{/name}","comments_url":"https://api.github.com/repos/linq2db/linq2db/issues/1471/comments","events_url":"https://api.github.com/repos/linq2db/linq2db/issues/1471/events","html_url":"https://github.com/linq2db/linq2db/issues/1471","id":391882256,"node_id":"MDU6SXNzdWUzOTE4ODIyNTY=","number":1471,"title":"How to clear query cache or force a rebuild after FluentMappingBuilder change","user":{"login":"Michael-Leslie","id":45493493,"node_id":"MDQ6VXNlcjQ1NDkzNDkz","avatar_url":"https://avatars0.githubusercontent.com/u/45493493?v=4","gravatar_id":"","url":"https://api.github.com/users/Michael-Leslie","html_url":"https://github.com/Michael-Leslie","followers_url":"https://api.github.com/users/Michael-Leslie/followers","following_url":"https://api.github.com/users/Michael-Leslie/following{/other_user}","gists_url":"https://api.github.com/users/Michael-Leslie/gists{/gist_id}","starred_url":"https://api.github.com/users/Michael-Leslie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Michael-Leslie/subscriptions","organizations_url":"https://api.github.com/users/Michael-Leslie/orgs","repos_url":"https://api.github.com/users/Michael-Leslie/repos","events_url":"https://api.github.com/users/Michael-Leslie/events{/privacy}","received_events_url":"https://api.github.com/users/Michael-Leslie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-17T20:43:48Z","updated_at":"2018-12-17T21:01:44Z","closed_at":null,"author_association":"NONE","body":"I think I need to clear the query cache to fix a problem that arises when I use a FluentMappingBuilder to change the mapping in between calls.  For the first call, it always follows the FluentMappingBuilder that I am holding in the MappingSchema that is contained in the data context, but every time after that, it uses the cached query even if the FluentMappingBuilder has changed.\r\n\r\nI have confirmed that the data context and its mapping schema inside the query are exactly as they should be.  I can get any of the various correct mappings to execute as long as it is the first call.\r\n\r\nI have an IExpressionQuery, but it does not expose a ClearCaches method.  Its internal member Info is a Query\\<T\\>, and I could use reflection to get to that ClearCaches method, but I do not like to sneak into internal members.\r\n\r\nThe cache is quite long lived (lifetime of process?).  Even if you dispose of the DataConnection, and create a new one, it will still find and use that cached query.  Is there a better way I should be clearing the query cache?  Alternatively, is there a way force a new query to be created?\r\n\r\nlinq2db version: 2.5.4\r\nDatabase Server: IBM.Data.DB2.iSeries 7.3\r\nDatabase Provider: LinqToDB.DataProvider.DB2iSeries 2.1.0.0\r\nOperating system: Windows 7\r\nFramework version: .NET Framework 4.5\r\n"},"comment":{"url":"https://api.github.com/repos/linq2db/linq2db/issues/comments/447997289","html_url":"https://github.com/linq2db/linq2db/issues/1471#issuecomment-447997289","issue_url":"https://api.github.com/repos/linq2db/linq2db/issues/1471","id":447997289,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0Nzk5NzI4OQ==","user":{"login":"sdanyliv","id":783759,"node_id":"MDQ6VXNlcjc4Mzc1OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/783759?v=4","gravatar_id":"","url":"https://api.github.com/users/sdanyliv","html_url":"https://github.com/sdanyliv","followers_url":"https://api.github.com/users/sdanyliv/followers","following_url":"https://api.github.com/users/sdanyliv/following{/other_user}","gists_url":"https://api.github.com/users/sdanyliv/gists{/gist_id}","starred_url":"https://api.github.com/users/sdanyliv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdanyliv/subscriptions","organizations_url":"https://api.github.com/users/sdanyliv/orgs","repos_url":"https://api.github.com/users/sdanyliv/repos","events_url":"https://api.github.com/users/sdanyliv/events{/privacy}","received_events_url":"https://api.github.com/users/sdanyliv/received_events","type":"User","site_admin":false},"created_at":"2018-12-17T21:01:44Z","updated_at":"2018-12-17T21:01:44Z","author_association":"MEMBER","body":"Show me please how do you change MappingSchema."}}
{"actor":{"display_login":"sdanyliv"}}