Executing this part of method I got exception in client, exception is:

Cannot roll back s0. No transaction or savepoint of that name was found.

Examining the debugger I have found:

using (VersionValidator.Attach(versionSet))
{
    using (var transaction = Transaction.Open(TransactionOpenMode.New))
    {
        var item = Query.Single<T>(id);
        using (var ir = Validation.Disable())
        {
            foreach (var keyValuePair in CleanUpValues(values))
            {
                item[keyValuePair.Key] = keyValuePair.Value;
            }

            ir.Complete();
        }

        Validation.Enforce();

        ...
        ValidateComments(item);
        ...

        transaction.Complete();
    }
}

The first exception occurs in

item[keyValuePair.Key] = keyValuePair.Value;

System.Reflection.TargetInvocationException was unhandled by user code
  Message=Exception has been thrown by the target of an invocation.
  InnerException: Xtensive.Storage.VersionConflictException
       Message=Version of entity with key 'GridSetting, (dc60186a-8f74-442a-a2b7-f363d5de0eef)' differs from the expected one.

Later this debugger jumps to Disposing of transaction scope and there is my exception: Cannot roll back s0. No transaction or savepoint of that name was found.

I was trying to reproduce this in isolated project, but without any success.

One more question is why this version mistmach occurs: ValidateComments may throw exception, and as far as I understand transaction should be rolled back and version should not change, but it has changed.

Could you indicate possible causes of this problem to create this in isolated project?

asked Sep 07 '10 at 04:59

pil0t's gravatar image

pil0t
207575763

edited Nov 12 '10 at 07:56

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

futher debugging show that changing

var item = Query.Single<T>(id);

to

var item = Query.All<T>().Where(a=>a.Id == id).Single();

fix the issue.

Possible there are no transaction open when I use Query.Single<T>(id) (chached item?) but on disposing try to rollback ?

(Sep 07 '10 at 06:11) pil0t pil0t's gravatar image

Do you use SessionOptions.AutoShortenTransactions option?

(Sep 08 '10 at 05:58) Alex Yakunin Alex%20Yakunin's gravatar image

Btw, there is definitely some bug. I'm just trying to figure out of it is already fixed in our development branch, or not.

(Sep 08 '10 at 06:00) Alex Yakunin Alex%20Yakunin's gravatar image

Yes, I use SessionOptions.AutoShortenTransactions option

(Sep 08 '10 at 06:08) pil0t pil0t's gravatar image
1

Try to turn off AutoShortenTransactions option - quite likely the problem will be fixed. Its support in current branch (v4.3) is buggy; we significantly refactored it in v4.4 branch (that's in development now), so further it should work as expected.

(Sep 30 '10 at 07:51) Alex Yakunin Alex%20Yakunin's gravatar image

Did this help?

(Oct 04 '10 at 13:05) Alex Yakunin Alex%20Yakunin's gravatar image

The issue is suspended, please see the comments.

(Nov 12 '10 at 09:14) Alex Yakunin Alex%20Yakunin's gravatar image

One Answer:

Issue created. Please answer to my comments, or add comments to the issue itself.

answered Sep 08 '10 at 06:05

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

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