Hello again,
yep, I missed the attribute. Sorry
Even with small number of changes, you can get the collision;)
I was thinking about the lock-based-problem with the
UpdateTimestampsCache. If you cache a really heavy queries than the
lock can hurt your performance a lot. If we're speakig about switching
to RWL for locking ontoUpdateTimestampsCache's methods:
- Invalidate - should be write-locked
- PreInvalidate - should be write-locked
- IsUpToDate - should be read-locked
I see no problem with switching to RWL, but...
One more thing/tip about profiling and performance of queries. If
performance is an issue and only some subset of entities properties is
used, please do projection. If the projection is applied on the query,
NHibernate caches tuples from the result. It gives only one hit to the
query cache, retriving all the needed data to hydratize the result.
When you query against an entity, with no projection, you can get
SELECT N+1 problem on your cache (the result of the query is cached as
an array of entities identifiers; entities must be fetched
separately). So if you query only for a simple flag
(ShouldBeAcceptedByManager) or sth like that - do projection (Select)
before ToList.
take care