5
votes

I have been trying to retrieve data from an Oracle 12g database using the following:

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

The underlying SQL is:

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.

There is only 1 record in the MYSCHEMA.MYTABLE table but when calling the .ToList() I get zero results.

Am I missing some setting with Oracle's Entity Framework?

Using from nuget:

  • Oracle 11g (11.2.0.1.0 - 64bit)
  • Official Oracle ODP.NET, Managed Entity Framework Driver (12.1.021)
  • Microsoft Entity Framework (6.1.3)
1

1 Answers

7
votes

Apparently when I inserted the new record into the MYSCHEMA.MYTABLE table I forgot to COMMIT it to the database.

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.

Lesson learned. Maybe this answer will be helpful to others.