Hi,
we are trying to set L2 Caching with ebean-redis (latest version) and I am running into an issue where it's complaining that the key its trying to encode is a UUID instead of a string but only in specific cases. I have these two models
@Cache
@Entity
class Organization {
@Id
UUID id;
@OneToMany(mappedBy="organization")
List<Account> accounts;
..
}
@Cache
@Entity
class Account {
@Id
UUID id;
@ManyToOne
Organization organization;
..
}
I get the following stacktrace when it tries to lazy load the accounts of the Organization object. (I also get it in a few other places but the issue is always in EncodePrefixKey.encode)
java.lang.RuntimeException: Failed to decode cache data
at io.ebean.redis.encode.EncodePrefixKey.encode(EncodePrefixKey.java:24)
at io.ebean.redis.RedisCache.key(RedisCache.java:90)
at io.ebean.redis.RedisCache.put(RedisCache.java:177)
at io.ebeaninternal.server.deploy.BeanDescriptorCacheHelp.cachePutManyIds(BeanDescriptorCacheHelp.java:327)
at io.ebeaninternal.server.deploy.BeanDescriptorCacheHelp.manyPropPut(BeanDescriptorCacheHelp.java:317)
at io.ebeaninternal.server.deploy.BeanDescriptor.cacheManyPropPut(BeanDescriptor.java:1215)
at io.ebeaninternal.api.LoadManyRequest.postLoad(LoadManyRequest.java:122)
at io.ebeaninternal.server.core.DefaultBeanLoader.loadMany(DefaultBeanLoader.java:38)
at io.ebeaninternal.server.core.DefaultServer.loadMany(DefaultServer.java:529)
at io.ebeaninternal.server.loadcontext.DLoadManyContext$LoadBuffer.loadMany(DLoadManyContext.java:222)
at io.ebean.common.AbstractBeanCollection.lazyLoadCollection(AbstractBeanCollection.java:90)
at io.ebean.common.BeanList.init(BeanList.java:141)
at io.ebean.common.BeanList.iterator(BeanList.java:327)
Caused by: java.lang.IllegalStateException: Expecting String keys but got type:class java.util.UUID
at io.ebean.redis.encode.EncodePrefixKey.encode(EncodePrefixKey.java:19)
... 67 common frames omitted