My question is: Can I configure OracleEntityProviderConfig.Instance.DmlOptions.BatchUpdates.Enabled only in the scope of a single query / DbContext instance?
I am using EF6 with dotConnect for Oracle. I will elaborate my scenario a bit in order to provide some context:
I have some larger inserts and update operations in my application, that affect a couple of thousand db entries. For those I see a big performance improvement when using OracleEntityProviderConfig.Instance.DmlOptions.BatchUpdates.Enabled = true.
However, as I do so, I do not see constraint violations or other issues when inserting new entities. DbMonitor reports:
Code: Select all
BEGIN INSERT INTO SCHEMA.TABLE(C1, C2) VALUES (:p0, :p1); INSERT INTO SCHEMA.TABLE(C1, C2) VALUES (:p2, :p3); END; -- -1 row(s) affected.
This is Ok for my big insert or update operations, but for all other operations in my application, I would need the exceptions from the database. So is there a way to enable batch operations only for specific queries?
Thanks for any hints or help.