Hi,
I get StackOverflowException with code like this:
internal class Program
{
public const int IterationsCount = 50000;
private static void Main(string[] args)
{
var dc = new DomainConfiguration("sqlserver", "Data Source=.; Initial Catalog=DO40-Tests; Integrated Security=True;")
{
UpgradeMode = DomainUpgradeMode.Recreate,
};
dc.Types.Register(typeof(Program).Assembly);
var sw = new Stopwatch();
using (var d = Domain.Build(dc))
{
using (var s = d.OpenSession(SessionConfiguration.Default))
using (s.Activate())
using (var t1 = s.OpenTransaction(TransactionOpenMode.New))
{
sw.Start();
var ent = new Ent();
for (var i = 0; i < IterationsCount; i++)
{
Session.Current.Query.All<Ent>().Where(z => z.Id == ent.Id).ToArray();
ent.Num = i;
if (i % 10 == 0)
{
Console.WriteLine($"{i} {sw.Elapsed.TotalSeconds}");
sw.Restart();
}
}
t1.Complete();
}
}
}
}
[HierarchyRoot]
public class Ent : Entity
{
[Field, Key]
public Guid Id { get; set; }
[Field]
public int Num { get; set; }
}
Stacktrace shows that cause of StackOverflowException is recursive call of Xtensive.Tuples.DifferentialTuple.Clone() method.
Also before StackOverflow is thrown performance dramatically decrease
DO version: 5.0.13
asked
Sep 05 '17 at 04:02
Gushchin Anton
11●27●27●29