ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fred (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (IGNITE-3429) org.hibernate.cache.spi.CacheKey not properly serialized by binary marshaller
Date Mon, 13 Feb 2017 12:50:41 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-3429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15860221#comment-15860221
] 

Fred edited comment on IGNITE-3429 at 2/13/17 12:49 PM:
--------------------------------------------------------

By chance, does anyone have some examples / tests?  Upgraded to apache ignite 1.8.  I configured
BinaryTypeConfiguration with (org.hibernate.cache.internal.OldCacheKeyImplementation) from
above then used files from https://issues.apache.org/jira/browse/IGNITE-1794 since on Hibernate
5.2.7.  I noticed the BinaryAbstractIdentityResolver being called and returning true but when
I call the same service I noticed the database being hit.  Also tried switching to Hibernate
4.3.11 and first workaround from above with same results.

XML Configuration from http://apacheignite.gridgain.org/v1.6/docs/hibernate-l2-cache
```
hibernate.cache.use_query_cache=true
hibernate.cache.use_second_level_cache=true
hibernate.cache.region.factory_class=org.apache.ignite.cache.hibernate.HibernateRegionFactory
org.apache.ignite.hibernate.default_access_type=READ_ONLY

<bean parent="transactional-cache">
     <property name="name" value="com.model.Access" />
</bean>

@Entity(name = "Person")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Person
```


was (Author: fwvista):
By chance, does anyone have some examples / tests?  Upgraded to apache ignite 1.8.  I configured
BinaryTypeConfiguration with (org.hibernate.cache.internal.OldCacheKeyImplementation) from
above then used files from https://issues.apache.org/jira/browse/IGNITE-1794 since on Hibernate
5.2.7.  I noticed the BinaryAbstractIdentityResolver being called and returning true but when
I call the same service I noticed the database being hit.  Also tried switching to Hibernate
4.3.11 and first workaround from above with same results.

Also, getting Caused by: java.lang.NoSuchMethodException: org.hibernate.cache.internal.OldCacheKeyImplementation.<init>()
since org.hibernate.cache.internal.OldCacheKeyImplementation doesnt have a default constructor.

XML Configuration from http://apacheignite.gridgain.org/v1.6/docs/hibernate-l2-cache
```
hibernate.cache.use_query_cache=true
hibernate.cache.use_second_level_cache=true
hibernate.cache.region.factory_class=org.apache.ignite.cache.hibernate.HibernateRegionFactory
org.apache.ignite.hibernate.default_access_type=READ_ONLY

<bean parent="transactional-cache">
     <property name="name" value="com.model.Access" />
</bean>

@Entity(name = "Person")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Person
```

> org.hibernate.cache.spi.CacheKey not properly serialized by binary marshaller
> -----------------------------------------------------------------------------
>
>                 Key: IGNITE-3429
>                 URL: https://issues.apache.org/jira/browse/IGNITE-3429
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache, Hibernate L2 cache
>    Affects Versions: 1.6
>            Reporter: Valentin Kulichenko
>            Assignee: Andrew Mashenkov
>            Priority: Critical
>             Fix For: 2.0
>
>
> {{org.hibernate.cache.spi.CacheKey}} is a class used as a key for all entries in the
Hibernate L2 cache. This class contains {{type}} field and custom {{equals}} logic where the
type is used as a helper and does not participate in comparison. Instances of the same type
are producing different hash codes in different JVMs, which actually breaks comparison when
binary format is used, where byte arrays are compared.
> The issue is described in more detail here: http://stackoverflow.com/questions/38132263/apache-ignite-as-hibernate-l2-cache-storing-duplicate-entities



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message