min*_*das 5 java persistence hibernate ehcache
我在尝试在对象更新时复制Hibernate二级缓存密钥时发现了一个奇怪的情况.
缓存键结构如下:
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
Run Code Online (Sandbox Code Playgroud)
我在这里可以看到的问题是cacheKey.type.typeScope有一个对o.h.i.SessionFactoryImpl被复制的本地的引用.应该typeScope(或其中一个祖先)不被宣布为短暂的吗?
看一下这个o.h.t.ComponentType类,我可以看到typeScope这个类中根本没有使用该属性,只是在构造函数中设置并保留.这是一个Hibernate错误吗?
注意:o.h.t.ComponentType当实体具有复合键并使用特殊标识符对象时使用.
我们使用Hibernate v3.6.7和Ehcache v2.4.4.这也发布在Hibernate用户论坛上.
编辑:我打开了HHH-6880,到目前为止还没有取得多大成功.
我还向Ehcache用户邮件列表发布了类似的消息,Alex @ Terracotta认为这是一个真正的问题,可能是HHH-5182在版本3.6中引入的,也影响了Ehcache序列化到磁盘等.这是hibernate-dev线程的链接.
| 归档时间: |
|
| 查看次数: |
380 次 |
| 最近记录: |