{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11824","repository_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore","labels_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11824/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11824/comments","events_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11824/events","html_url":"https://github.com/aspnet/EntityFrameworkCore/issues/11824","id":317926301,"number":11824,"title":"Stateful provider across connections","user":{"login":"pdrhsm","id":16030859,"avatar_url":"https://avatars0.githubusercontent.com/u/16030859?v=4","gravatar_id":"","url":"https://api.github.com/users/pdrhsm","html_url":"https://github.com/pdrhsm","followers_url":"https://api.github.com/users/pdrhsm/followers","following_url":"https://api.github.com/users/pdrhsm/following{/other_user}","gists_url":"https://api.github.com/users/pdrhsm/gists{/gist_id}","starred_url":"https://api.github.com/users/pdrhsm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdrhsm/subscriptions","organizations_url":"https://api.github.com/users/pdrhsm/orgs","repos_url":"https://api.github.com/users/pdrhsm/repos","events_url":"https://api.github.com/users/pdrhsm/events{/privacy}","received_events_url":"https://api.github.com/users/pdrhsm/received_events","type":"User","site_admin":false},"labels":[{"id":420187509,"url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/labels/area-external","name":"area-external","color":"d4c5f9","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-26T08:27:56Z","updated_at":"2018-04-27T15:25:38Z","closed_at":"2018-04-26T16:45:10Z","author_association":"NONE","body":"Creating a context connecting to Oracle 12g, then creating a new context connecting to Oracle 11g causes EF to generate invalid SQL. In this case, it is caused by the SingleOrDefault it seems.\r\n\r\nTied to this [issue](https://forums.devart.com/viewtopic.php?f=1&t=34749) over in the Devart forums.\r\n\r\n```\r\n----- Inner Stack Trace -----\r\n   at Devart.Data.Oracle.az.a()\r\n   at Devart.Data.Oracle.am.g()\r\n   at Devart.Data.Oracle.am.f()\r\n   at Devart.Data.Oracle.an.a()\r\n   at Devart.Data.Oracle.c6.a(am A_0, Int32 A_1)\r\n   at Devart.Data.Oracle.c6.a(Int32 A_0, bh A_1)\r\n   at Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)\r\n   at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)\r\n   at Devart.Data.Oracle.Entity.ak.a(CommandBehavior A_0)\r\n   at Devart.Common.Entity.cs.d(CommandBehavior A_0)\r\n   at Devart.Data.Oracle.Entity.ak.b(CommandBehavior A_0)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)\r\n   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.BufferlessMoveNext(Boolean buffer)\r\n   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()\r\n   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)\r\n   at lambda_method(Closure , QueryContext )\r\n   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass17_1`1.<CompileQueryCore>b__0(QueryContext qc)\r\n```\r\n\r\n### Steps to reproduce\r\n * Create a simple context\r\n * Connect to Oracle 12g database\r\n * Issue a SingleOrDefault on a entity\r\n * Do repeat with Oracle 11g database\r\n\r\n### Further technical details\r\nEF Core version: 2.0.1\r\nDatabase Provider: Devart.Data.Oracle.EFCore\r\nOperating system: Windows 10\r\nIDE: Visual Studio 2017 15.6.6\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/comments/385004435","html_url":"https://github.com/aspnet/EntityFrameworkCore/issues/11824#issuecomment-385004435","issue_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11824","id":385004435,"user":{"login":"ajcvickers","id":1430078,"avatar_url":"https://avatars1.githubusercontent.com/u/1430078?v=4","gravatar_id":"","url":"https://api.github.com/users/ajcvickers","html_url":"https://github.com/ajcvickers","followers_url":"https://api.github.com/users/ajcvickers/followers","following_url":"https://api.github.com/users/ajcvickers/following{/other_user}","gists_url":"https://api.github.com/users/ajcvickers/gists{/gist_id}","starred_url":"https://api.github.com/users/ajcvickers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajcvickers/subscriptions","organizations_url":"https://api.github.com/users/ajcvickers/orgs","repos_url":"https://api.github.com/users/ajcvickers/repos","events_url":"https://api.github.com/users/ajcvickers/events{/privacy}","received_events_url":"https://api.github.com/users/ajcvickers/received_events","type":"User","site_admin":false},"created_at":"2018-04-27T15:25:38Z","updated_at":"2018-04-27T15:25:38Z","author_association":"MEMBER","body":"@pdrhsm The example they give for SQL Server is flawed. The SQL Server provider can generate different SQL based on options turned on or off in the configuration. For example:\r\n```C#\r\nvar optionsBuilder = new DbContextOptionsBuilder();\r\noptionsBuilder.UseSqlServer(@\"server=dbmssqlx64\\mssql2016;initial catalog=test;user id=sa;\");\r\nvar context = new ModelContext(optionsBuilder.Options);\r\nvar result = context.Dept.Skip(1).FirstOrDefault(); // success\r\n\r\nvar optionsBuilder2 = new DbContextOptionsBuilder();\r\noptionsBuilder2\r\n    .UseSqlServer(@\"server=dbmssql\\mssql2008;initial catalog=test;user id=sa;\")\r\n    .UseRowNumberForPaging();\r\nvar context2 = new ModelContext(optionsBuilder2.Options);\r\nvar result2 = context2.Dept.Skip(1).FirstOrDefault(); // success\r\n```\r\nThe Devart provider should do something similar for their case.\r\n"}}
{"actor":{"display_login":"ajcvickers"}}