-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Question
We are planning to use entity framework for ORM integration with our oracle database. But we soon also plan to use Oracle Edition-based redefinition (EBR) for zero downtime deployments. In order for EBR to work, applications must only query data via editioned views (never directly against the tables).
When experimenting with this architecture we are running into problems when it comes to testing. One issue is that our views do not have a primary key and thus cannot be tracked with EF. We often get runtime exceptions saying that a certain entity cannot be tracked because it does not have a primary key.
Furthermore, we are unsure on how to build unit tests which do not assume any underlying knowledge of the database. For example, if we have some Table X that is exposed by View Y, the developer creating unit tests has to know to seed data into Table X even though the underlying code never directly interacts with that table. This becomes more complicated with views that involve multiple tables. Is there something wrong with our approach here, or some way that we can write tests which only interact with the objects which are actually exposed to the application?
Your code
Stack traces
Verbose output
EF Core version
9.0.0
Database provider
Oracle.ManagedProvider
Target framework
.NET 9.0
Operating system
Windows 11
IDE
Visual Studio 2022 (latest)