Batch updates with GLOBAL TEMPORARY table

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
syl74
Posts: 6
Joined: Tue 21 Oct 2008 13:59

Re: Batch updates with GLOBAL TEMPORARY table

Post by syl74 » Fri 16 Sep 2011 15:30

Hello,
In order to insert a lot of rows in a GLOBAL TEMPORARY table (ON COMMIT DELETE ROWS), I'm using batch update mode.
According to DBMonitor, I noticed that batch statements are sent only when I perform a COMMIT on the transaction (which is not compatible with ON COMMIT DELETE ROWS).
Is there a way to force de EF4 to send the batch updates orders immediatly ?

My goal is (in one transaction) to insert many rows in the GLOBAL TEMPORARY table and then use this table to perform a select on other tables WITH a join on this GLOBAL TEMPORARY table.
Right now, when I perform the select, it like the GLOBAL TEMPORARY table is empty.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 20 Sep 2011 15:45

Batch Updates in Entity Framework is tightly tied to the local transaction.
There is no convenient solution at the moment. We can suggest you a workaround (only for single thread applications which use batch updates): if you know the number (N) of entities which you are going to insert into your database, set BatchSize=N:

Code: Select all

  var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
  config.DmlOptions.BatchUpdates.Enabled = true;
  config.DmlOptions.BatchUpdates.BatchSize = N;
The SQL will be generated on SaveChanges() and your entities will be sent to the database.

cjbiggs
Posts: 105
Joined: Fri 15 Jan 2010 19:56

Post by cjbiggs » Tue 17 Jan 2012 23:29

Can Batch Updates be using in a multi-threaded application?

Thanks,

Charlie J.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 18 Jan 2012 17:31

Batch Updates can be successfully used in a multi-threaded application. About Batch Updates: http://www.devart.com/blogs/dotconnect/ ... html#Batch.
Shalex wrote:We can suggest you a workaround (only for single thread applications which use batch updates): ...
There is "single thread" here because this is a case of inserting data into GLOBAL TEMPORARY tables.

Post Reply