I have not looked at the spring code you mention specifically, however caching
entity instances directly as opposed to storing the entity states is never
going to work. Going this route requires that you synchronize access to the
entities in the application since multiple threads/transactions would refer to
this same instance.
Now there as been discussion about allowing sotrage of certain types of
entities directly into the second level cache (think reference tables). But
there are very strict requirments there. Like only immutable entities would
be eligible; only entities without associations would be eligible; etc.
On Wednesday, February 23, 2011, at 10:04 am, Marc Schipperheyn wrote:
It would be interesting to have the Hibernate team comment/blog on
the new
Spring Cache Abstraction functionality and how it relates to Hibernate
managed entities. Perhaps some strategies, etc. It's very attractive to
just cache entities in stead of caching entity values with the second
level cache.
_______________________________________________
hibernate-dev mailing list
hibernate-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev
---
Steve Ebersole <steve(a)hibernate.org>
http://hibernate.org