From: Gavin_King/Cirrus%<CI...@ci...> - 2002-03-03 13:50:08
|
> some general questions: where does this cache fit in? Is it per > Datastore, per Session, or something else? per session factory. > What's the intended purpose of the cache? Well, people asked for it...... its intended to increase performance by caching data that changes rarely (or is never changed by the application) between transactions. Many applications will have a set of data that it modifies, and another set of "reference" or "static" data that it can sensibly cache between transactions. Possibly the static data changes rarely, or it changes on a predictable cycle (daily, for example). There is no reason to force hibernate to re-select that data each session. On the other hand, you could easily mount a convincing case that the application itself should be responsible for caching this stuff... There is also data that is mostly read and very rarely updated. Its harder for the application to manage its own cache in this situation. For performance reasons, we would like to be able to get some caching going here. I am certainly *not* trying to implement caching for the case of data which is frequently updated. I feel this a harder problem and the caching algorithm i implemented doesn't improve performance in this case. > This might sounds like a > trivial question, but I can't tell from the discussion. A lot of it > seems to be heading away from just a lightweight persistence layer. Well, this is the line i have drawn: if implementing caching would require any significant added complexity to the core persistence engine, or if it would have a negative performance impact upon the vanilla case of no caching, I will happily drop the idea. The way i've done it at the moment satisifies these requirements. This is added to the other requirement that hibernate never ever uses in-memory locks upon objects. > Scared, PaulS :| Yeah, yeah, i know, i know ..... its against the spirit of the project, it cant scale to a cluster, I can see neither you nor Doug like it and i'm not that keen on it myself. Its not hurting anything by staying there for the moment, but I also promise not to document it for the moment. I also promise we wont head further down this path (i never intended to, actually). |