Closed tandonraghav closed 6 years ago
Are you flush JVM1 Updated entity?
If you mean JVM1 entity is cached , then yes and it is persisted in Redis and JVm2 as well persisted in redis.
I mean Session flush entity to save to Database, If you do that, I will check this issue
It is a select call only so no persisting to Database.
It's hibernate problem about query and find by cache key from cache server.
I am using
Query caching
and I came across a scenario ...I have 2 jvms where same entity has different definition (assume 1 jvm is not upgraded) .
JVM 1 - Updated Entity having boolean flag; JVM2 - Not updated.
JVM1 does a findBy method resulting in
Id#9
then Query is stored as key (sayQ1
) JVM2 does same findBy resulting inId#9
then Query is stored as key (sayQ2
) , here Id#9 object is also changing in cache. JVM1 again queries but this time it getsId#9
which JVM2 has put, resulting in exception saying Null cannot be put in primitive type.Can there be some identifier which identifies that
Q2
corresponding isId#9
, so ifQ1
looks up it does'nt getQ2
'sId#9
If you dont consider this as an enhancement, then close this.