|
From: Max R. A. <max...@jb...> - 2006-05-05 08:32:00
|
could probably just be solved with a proper equals/hashcode impl; but custom serialization would also work but not if it influences possible subclasses. > Hi! > > I already posted on the user list, but I looks like due to the massive > posts it got lost. > I took many time to think about this issue, and so I'll post it to your > dev list as I'll eventually try to create a patch for it. > > Hibernate version: > 3.2.0 rc1 > > A serialized/deserialized DetachedCriteria do not work correctly with > the query cache. > The problem is the ResultTransformer in QueryKey. > > In CriteraImpl the resultTransformer will be set to Criteria.ROOT_ENTITY. > This makes it down into the QueryKey. > > After serialize/deserialize the instance of resultTransformer in > CriteriaImpl has changed (not that a surprise ;-) ) and thus - in the > end - the QueryKey changed. > > Subsequent lookup in the query-cache will no longer work. > The query will be executed again and put int the query-cache. > The cache grows - every lookup failes. > > I think every ResultTransformer used as singleton should implement some > custom deserialization code so that always the same instance will be > returned - this is one solution. > > What solution do you prefer? Just in case I manage to send a patch. > > Thanks! > Ciao, > Mario > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > hibernate-devel mailing list > hib...@li... > https://lists.sourceforge.net/lists/listinfo/hibernate-devel -- -- Max Rydahl Andersen callto://max.rydahl.andersen Hibernate ma...@hi... http://hibernate.org JBoss Inc max...@jb... |