开发者

Castle ActiveRecord optimistic locking on properties

开发者 https://www.devze.com 2022-12-28 01:23 出处:网络
Can Castle ActiveRecord do optimistic locking on properties? I found optimistic locking for the entire class, but not for an individual property. In my case, I need to make it so that adding/removing

Can Castle ActiveRecord do optimistic locking on properties? I found optimistic locking for the entire class, but not for an individual property. In my case, I need to make it so that adding/removing elements in a collection does not update the version number of the entity (so for example, adding a Product to a Store wit开发者_Python百科hout changing any of Store's properties will not increment the version number).


NHibernate supports an optimistic-lock property that can be applied to properties or collections and does exactly what you want when set to false (default is true)

I think ActiveRecord doesn't currently expose it. Not sure how hard it would be to extend it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号