We're using dotConnect for Oracle as our Entity Framework data provider for our Oracle data implementation and we are very please with it.
Our app uses EF for both Sql Server and Oracle. We have a few queries that we've needed to convert to store procedures due to performance issues. One specifically, passes an IDataReader via a SqlParameter of SqlDbType.Structured to a sproc that does a number of bulk operations. This sproc handles tens of thousands of records with great speed.
We need a high performance means of accomplishing the same result on our Oracle implementation. Does dotConnect for Oracle or any other Devart product provide a means of handling bulk records from EF in a speedy manor?
Any ideas or recommendations will be appreciated.
How to bulk process records with Entity Framework and Oracle
Re: How to bulk process records with Entity Framework and Oracle
Please refer to http://blogs.devart.com/dotconnect/new- ... html#Batch.cResults wrote:Does dotConnect for Oracle or any other Devart product provide a means of handling bulk records from EF in a speedy manor?
Re: How to bulk process records with Entity Framework and Oracle
Thank you Shalex.
I read through the post you linked to. I don't think this will work for us. First, the limitation of not being able to use TransactionScope, likely disqualifies this as an option.
Second, if the following means that we can't insert a collection of records and receive back the primary key this won't work.
If I'm wrong about being able to receive the primary key or if there are any other options, please let me know.
Respectfully,
cResults
I read through the post you linked to. I don't think this will work for us. First, the limitation of not being able to use TransactionScope, likely disqualifies this as an option.
Second, if the following means that we can't insert a collection of records and receive back the primary key this won't work.
We need to be able to insert a batch of records, get the primary key from the output and insert records in two child tables. In Sql Server we can do this with a single stored procedure. Can this be done in Oracle?The following statements cannot be put into batches:
Statements with the RETURNING clause, for example, statements that update or insert entities with columns having the StoreGeneratedPattern attribute value set to Identity or Computed.
If I'm wrong about being able to receive the primary key or if there are any other options, please let me know.
Respectfully,
cResults
Re: How to bulk process records with Entity Framework and Oracle
If you are going to work within TransactionScope, we recommend you to use a fast data insertion of the ADO.NET level:cResults wrote:the limitation of not being able to use TransactionScope, likely disqualifies this as an option.
1. OracleLoader class -> http://www.devart.com/dotconnect/oracle ... oader.html
2. Array binding -> http://www.devart.com/dotconnect/oracle ... yBind.html
For this, please use OracleCommand.ExecuteNonQuery() and pass IDs generated in the database back via return or output parameters of OracleCommand.cResults wrote:get the primary key from the output and insert records in two child tables.
Re: How to bulk process records with Entity Framework and Oracle
The current EF6 architecture doesn't allow to use Batch Updates with StoreGeneratedPattern=Identity/Computed.
A workaround for the case when the current context instance is used for the batch updates operation only: modify a metadata, used for creating context instance, by removing StoreGeneratedPattern=Identity/Computed from properties. This is easier to do with fluent mapping (this is possible with XML Mapping as well).
A workaround for the case when the current context instance is used for the batch updates operation only: modify a metadata, used for creating context instance, by removing StoreGeneratedPattern=Identity/Computed from properties. This is easier to do with fluent mapping (this is possible with XML Mapping as well).