• Bug
  • Status: Resolved
  • 2 Major
  • Resolution: Fixed
  • ehcache-core
  • alexsnaps
  • Reporter: asauvez
  • November 29, 2011
  • 2
  • Watchers: 5
  • December 23, 2013
  • December 23, 2013

Attachments

Description

In the default ignored ressources (“builtin-sizeof.filter”), you should also ignore :

org.hibernate.cache.QueryKey.positionalParameterTypes org.hibernate.cache.QueryKey.entityMode

It’s the key used by Hibernate where storing a query with Query.setCacheable(true)

By the way, if the key DefaultSizeOfEngine.USER_FILTER_RESOURCE was made public, it would help us use it.

Comments

Chris Dennis 2011-11-29

I’ve already fixed part of this - but being a naughty boy I didn’t file a JIRA for it. The changes are in svn here: http://svn.terracotta.org/fisheye/changelog/Ehcache?cs=4987

As you can see I’ve also added a few other excludes there, the TypedValue ones are to cover named parameters correctly, and I’ve also covered the same fields in Hibernate 4.x.

I’ve also made the property name field public, you’re right having it private makes very little sense: http://svn.terracotta.org/fisheye/changelog/Ehcache?cs=4997 http://svn.terracotta.org/fisheye/changelog/Ehcache?cs=4998

Adrien OpenWide 2012-01-04

Using version 2.5.0 on a bigger project with Hibernate 3.6.9. I found those entries to be necessary :

org.hibernate.proxy.AbstractLazyInitializer.session org.hibernate.proxy.AbstractLazyInitializer.entityName org.hibernate.proxy.pojo.BasicLazyInitializer.persistentClass org.hibernate.proxy.pojo.BasicLazyInitializer.getIdentifierMethod org.hibernate.proxy.pojo.BasicLazyInitializer.setIdentifierMethod org.hibernate.proxy.pojo.BasicLazyInitializer.componentIdType org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.interfaces org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.interfaces org.hibernate.collection.AbstractPersistentCollection.session

It is necessary when having a composite-id with a many-to-one in it (ugly, but legacy code, so sorry). In this case, an Hibernate proxy may be used in the key. So it is stored in ehCache. This proxy has a “handler” attribute with Javassit or CGLib stuff in it. The handler contains a link to the Session.

I don’t know the equivalent of those classes in Hibernate 4.

Fiona OShea 2012-01-04

Re-opening waiting for Chris to comment

Chris Dennis 2012-01-04

If you could provide us with a test case that illustrates your problem that would be great. Failing that the mapping config files and any hibernate specific code (e.g. custom types) you’re using would help us figure out what the next step should be here.

Adrien OpenWide 2012-01-06

Without the modification in builtin-sizeof.filter, when executing HibernateCacheTest line 214, you have the error :

ATTENTION: The configured limit of 1 000 object references was reached while attempting to calculate the size of the object graph. (…)

Fiona OShea 2012-01-25

Chris sending this over to you for comment review.

Alexander Snaps 2012-02-10

There are a couple of concerns I have here. Some regarding the mapping and caching, but most importantly to how much trouble we’ll have maintaining all these exception. Linking to this JIRA for the latter. On the former, will reply independently. Currently working on some blog post and example code.

Adrien OpenWide 2012-02-21

You should also add those lines (in Hibernate 3.6.9). They seems to be needed if your query use projections.

org.hibernate.engine.TypedValue.type org.hibernate.engine.TypedValue.entityMode

TypedValue is basically a value and a type. We ignore the type and the entityNode, leaving the value still scanned.

Craig Andrews 2013-12-03

[~cdennis] can you give us an update? I think it would be really great if all these Hibernate types could make it into the bundled builtin-sizeof.filter.

Alexander Snaps 2013-12-06

Graig, ehcache 2.8.0 will contain a hook for dealing with this (see EHC-924). Am currently working on polishing this and providing a hibernate module for that (which I’ll eventually merge back into the hibernate-ehcache project directly)

Alexander Snaps 2013-12-23

This as been solved by using the new pluggable sizeof engine module here: http://terracotta-oss.github.io/ehcache-sizeofengine/

There are links to both the hibernate v3 & v4 modules.