-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Replicating org.hibernate.cache.CacheKey
PostPosted: Tue Dec 06, 2011 1:30 pm 
Newbie

Joined: Tue Oct 21, 2008 8:14 am
Posts: 3
Location: London
I have discovered a strange case when trying to replicate a Hibernate 2nd level cache key on object update.

The cache key structure is like this:

cacheKey = {org.hibernate.cache.CacheKey}
|- key = {my.own.serializable.class}
|- type = {org.hibernate.type.ComponentType}
| |- typeScope = {org.hibernate.type.TypeFactory$TypeScopeImpl}
| | |- factory = {org.hibernate.impl.SessionFactoryImpl}
| |- propertyNames = {...}
| |- propertyTypes = {...}
| |- propertyNullability = {...}
| |- propertySpan = 2
| |- cascade = {...}
| |- joinedFetch = {...}
| |- isKey = true
| |- tuplizerMapping = {...}
|- entityOrRoleName = {java.lang.String} "my.Entity"
|- entityMode = {org.hibernate.EntityMode}
|- hashCode = 588688

The problem I can see here is that cacheKey.type.typeScope has a reference to my local SessionFactoryImpl which gets replicated over. Should typeScope (or one of its ancestors) not be declared as transient?

Looking at the o.h.t.ComponentType class I can see that typeScope attribute is not used at all in this class but only set in the constructor and kept in. Is this a Hibernate bug?

NOTE: ComponentType is used when the entity has a composite key and uses special identifier object for it.

We use Hibernate v3.6.7 and Ehcache v2.4.4.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.