[英]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使用:
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.