As far as I know, NH has no built in support for coarse grained locks 
(http://www.martinfowler.com/eaaCatalog/coarseGrainedLock.html). 

I guess there are different ways to solve this but we solved it using an 
interceptor.
Inside our aggregates every ref is bidirectional (we need it for other purposes 
anyhow), meaning that every entity can easy find its root. When the uow is 
flushed and an entitiy is changed, our interceptor will keep track of what 
roots are affected. After this, a second flush will occur that only handles 
these "marked roots" (where the <version> is defined). Because this happens 
inside one tran, the outcome will be that we have one version per aggregate.

Cannot say if that's acceptable for you, but in our app it works fine with 
acceptable perf. 

Regards
Roger


________________________________________
Från: [email protected] [[email protected]] f&#246;r Greg Young 
[[email protected]]
Skickat: den 23 april 2009 21:22
Till: [email protected]
Ämne: [nhusers] Version

how can I define child objects to use a parent's object versioning number?

i.e.

Student
    classes

If there is a change to any class the student's version number changes

The specific scenario is for a DDD aggregate.

Thanks,

Greg

--
It is the mark of an educated mind to be able to entertain a thought
without accepting it.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to