How to specify optimistic-lock="false" on Property ?

lukasz.podolak's Avatar

lukasz.podolak

06 Oct, 2010 11:18 AM via web

Hi,
In previous version I think I was able to do this using something similar to:
mapping.Map(s => s.Value).SetAttribute("optimistic-lock", "false");

now I do not see the SetAttribute method, instead there is OptmisticLock(), but I assume that this means that whenever this property is dirty, the whole class version will increment. I want the opposite. How can I do this ?
I do not see the possibility to do the same on mapping.References(..) either, and this is also what I need.

How can I achieve both ?
thanks for any guidance
Łukasz Podolak

  1. Support Staff 2 Posted by James Gregory on 06 Oct, 2010 11:22 AM

    James Gregory's Avatar

    Not.OptimisticLock()

  2. 3 Posted by lukasz.podolak on 06 Oct, 2010 12:23 PM

    lukasz.podolak's Avatar

    thanks James,

    That works for a simple property, however what about a component ?
    I mean:

    mapping.References(e => e.VersionedReference).ThereIsNo_OptimisticLock_Here ?

    thanks
    Łukasz

  3. Support Staff 4 Posted by Paul Batum on 16 Oct, 2010 09:46 AM

    Paul Batum's Avatar

    Hi Łukasz,

    I've implemented support for this. You can get it on my repository:
    http://github.com/paulbatum/fluent-nhibernate/tree/dev

    <http://github.com/paulbatum/fluent-nhibernate/tree/dev>It should be pulled
    into the official trunk before long.

    2010/10/6 Łukasz Podolak <
    ***@tenderapp.com<tender%***@tenderapp.com>
    >

  4. 5 Posted by lukasz.podolak on 17 Oct, 2010 12:04 PM

    lukasz.podolak's Avatar

    Paul,

    Many, many thanks for your efforts.

  5. Support Staff 6 Posted by James Gregory on 17 Oct, 2010 01:04 PM

    James Gregory's Avatar

    Pauls changes have been merged into the main master branch. Thanks.

    2010/10/17 Łukasz Podolak <
    ***@tenderapp.com<tender%***@tenderapp.com>
    >

  6. 7 Posted by Jason Reimer on 09 Feb, 2011 06:02 PM

    Jason Reimer's Avatar

    This same issue seems to still exist on the one-to-many side of things, and generates the wrong xml for a bag (set/collection, etc) element if you use Optimistic.None(). Not.Optimistic is not support on the IOneToManyCollectionInstance or OneToManyPart. Is a fix for this in the works as well?

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What is 14 minus 4?