简体   繁体   English

Oracle ODP.NET实体框架返回空结果

[英]Oracle ODP.NET Entity Framework returning empty results

I have been trying to retrieve data from an Oracle 12g database using the following: 我一直在尝试使用以下方法从Oracle 12g数据库中检索数据:

    using (MyDbContext db = new MyDbContext())
    {
        var t = db.MyTable.ToList();
    }

The underlying SQL is: 底层SQL是:

SELECT 
"Extent1"."TOKEN" AS "TOKEN", 
"Extent1"."FINGERPRINT" AS "FINGERPRINT", 
"Extent1"."EXPIRES" AS "EXPIRES", 
"Extent1"."ISSUED" AS "ISSUED"
FROM "MYSCHEMA"."MYTABLE" "Extent1

I run the SQL above within Oracle SQL Developer and it works just fine. 我在Oracle SQL Developer中运行上面的SQL,它运行得很好。

There is only 1 record in the MYSCHEMA.MYTABLE table but when calling the .ToList() I get zero results. MYSCHEMA.MYTABLE表中只有1条记录,但是当调用.ToList()我得到零结果。

Am I missing some setting with Oracle's Entity Framework? 我错过了Oracle实体框架的一些设置吗?

Using from nuget: 从nuget使用:

  • Oracle 11g (11.2.0.1.0 - 64bit) Oracle 11g(11.2.0.1.0 - 64bit)
  • Official Oracle ODP.NET, Managed Entity Framework Driver (12.1.021) 官方Oracle ODP.NET,托管实体框架驱动程序(12.1.021)
  • Microsoft Entity Framework (6.1.3) Microsoft实体框架(6.1.3)

Apparently when I inserted the new record into the MYSCHEMA.MYTABLE table I forgot to COMMIT it to the database. 显然,当我插入新记录到MYSCHEMA.MYTABLE表我忘了COMMIT它的数据库。

Therefore, the Oracle SQL Developer tool was able to show me that the record was en route to becoming a record but until I committed it no other external process would be able to retrieve the record. 因此,Oracle SQL Developer工具能够向我显示记录正在成为记录,但在我提交之前,没有其他外部进程能够检索记录。

Lesson learned. 学过的知识。 Maybe this answer will be helpful to others. 也许这个答案对其他人有帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Oracle实体数据模型(ODP.NET) - Oracle Entity Data Model(ODP.NET) Oracle ODP.Net与实体框架6 - 无法找到实体框架数据库兼容的提供程序 - Oracle ODP.Net With Entity Framework 6 - Entity framework database compatible provider could not be found 使用Oracle ODP.NET在.NET实体框架中调用SaveChanges时发生InvalidOperationException - InvalidOperationException when calling SaveChanges in .NET Entity framework with Oracle ODP.NET 如何使用Entity Framework 5和ODP.NET托管提供程序使用字符串键搜索Oracle表 - How to search Oracle table with a string key using Entity Framework 5 and the ODP.NET Managed Provider 仅比较实体框架6中的datetime与odp.net Oracle 12c的时间 - Compare only time from datetime in entity framework 6 with odp.net Oracle 12c 在Entity Framework / ODP.NET中的数据库读/写事件之前设置Oracle会话变量 - Setting Oracle session variables prior to database read/write events in Entity Framework / ODP.NET 将实体框架与现有的ORACLE DB一起使用。 Visual Studio 2012和不建议使用的ODP.NET驱动程序 - Use Entity Framework with existing ORACLE DB. Visual Studio 2012 and Deprecated ODP.NET Driver Oracle ODP.Net with Entity Framework 6 - ORA-00955 on Select from Table View - Oracle ODP.Net With Entity Framework 6 - ORA-00955 on Select from Table View 在oracle odp.net上使用实体farmework6 - using entity farmework6 with oracle odp.net 这是Oracle ODP.NET中的错误吗? - Is this a bug in the Oracle ODP.NET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM