Devart.Data.Oracle.EFCore 9.6.696
Oracle 11.2.0.2.0
Connection mode: direct
I've created 2 simple entities in C#
Code: Select all
public class DataWithClob
{
public Guid Id { get; set; }
public string Value { get; set; }
}
public class DataWihoutClob
{
public Guid Id { get; set; }
public string Value { get; set; }
}
Code: Select all
modelBuilder.Entity<DataWihoutClob>().Property(e => e.Value).HasColumnType("nvarchar2(2000)");
modelBuilder.Entity<DataWithClob>().Property(e => e.Value).HasColumnType("clob");
Code: Select all
var stopwatch = new Stopwatch();
stopwatch.Start();
using (var transaction = _context.Database.BeginTransaction())
{
_context.Entities.AddRange(data);
_context.SaveChanges();
transaction.Commit();
}
stopwatch.Stop();
Same insert using SQL completes in a fraction of a second in both cases.
Performance profiler shows that Devart.Data.Oracle.OracleLob.WriteLobCache seems to be causing the performance issue. I've found a (maybe) related post in Delphi DAC forum viewtopic.php?t=35225 The solution was apparently to turn off Lob Cache. I have not found such an option in Entity Framework adapter.
This makes me a very sad developer. Please advise.