Here is the test case http://sdrv.ms/Y8wI3X In short:

var versions = new VersionSet();
using (var t = Session.Current.OpenTransaction(TransactionOpenMode.New))
{
    var ent = Query.All<EntityBaseImpl>().First(e => e.Id == docId);
    versions.Add(ent, true);

    t.Complete();
}

using (VersionValidator.Attach(versions))
using (var t = Session.Current.OpenTransaction(TransactionOpenMode.New))
{
    var ent = Query.All<EntityBaseImpl>().First(e => e.Id == docId);

    Thread.Sleep(3000);

    ent.Finished = DateTime.Now;
}

asked Nov 29 '12 at 03:16

xumix's gravatar image

xumix
425757682

edited Nov 29 '12 at 03:18


One Answer:

Hello xumix,

this is currently expected behavior with read committed isolation level.

We'll consider improving version validation to allow this isolation level.

answered Dec 05 '12 at 08:38

Denis%20Krjuchkov's gravatar image

Denis Krjuchkov
179325

Actually, I've found a workaround. this code works as expected

using (var t = Session.Current.OpenTransaction(TransactionOpenMode.New))
{
var ent = Query.All<EntityBaseImpl>().First(e => e.Id == docId);

Thread.Sleep(3000);

var ent2 = Query.All<EntityBaseImpl>().First(e => e.Id == docId);
ent.Finished = DateTime.Now;
}
(Dec 05 '12 at 08:46) xumix xumix's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA