Search code examples
oracleentity-frameworkoracle-sqldeveloperef-core-2.2data-persistence

Oracle SQL changes in sqldeveloper are not reflected in EFCore


I have not used oracle with EF before, so I dont know how to deal with this weird thing happening. And cant find solutions online.

When I make changes on SQLdeveloper (updates/inserts) using sql, they are shown in SQLdeveloper, but not in app using EF.

When I make changes in EF, those are shown in SQLdeveloper.

In other words the APP shows data only from EF, but on SQLdeveloper I can see both. I have restarted the app multiple times and they are still not showing.

EDIT:

By make changes I mean any data changes. Like :

insert into table
(columns)
values(values);

And SQLdeveloper says inserted 1 row. And when I select * from table I see the row.

In the app, when I do inspect of context.TableSET.ToList() the row is not there.

but if I do

context.TableSET.Add(tableobj); 
context.SaveChanges();

I can see the row using SQLdeveloper


Solution

  • You need to execute the COMMIT statement after executing your changes so that it gets reflected in another session.

    EF is using another session and Without COMMIT, changes are only reflected in the current session, That is why it is visible in SQL Developer and not in EF.

    Cheers!!