Hello!
I am trying to figure out how the second level cache handles subclasses.
I was a bit surprised that the <cache>-attribute is only allowed for <class>-entries but not for e.g. <joined-subclass> entries. I did search the forum without finding an answer why this is not allowed. But i guess there's a good reason for it which i did not see yet - can someone tell me about it?
Accepting that <cache>-settings are only possible for the top level classes, i wondered how the subclasses are handled. My experiments seem to show the following:
- an entry like <cache name="net.package.classname" .../> in the cache configuration is only evaluated for the top level class which has the cache attribute. Derived classes use the same setting as the top level class.
- all instances of the subclasses are cached in the same region, so it is not possible to configure caching subclass specific.
Am i correct with these two observations?
Is there no way to configure caching individually for the subclasses?
Thanks for your answers!
Sebastian
|