kims-developergroup / hibernate-arcus Goto Github PK
View Code? Open in Web Editor NEWHibernate 2nd cache implementation using Arcus cache
Hibernate 2nd cache implementation using Arcus cache
Is your feature request related to a problem?
When connecting arcus cluster, a main thread is hanging
Describe the solution you'd like
Is your feature request related to a problem? Please describe.
In some cases, a cache entity might be necessarily evicted on cache put.
Describe the solution you'd like
An cachePut operation does evict a current cache entity prior to putting the entity if exists.
The cacheEvict on cachePut is optionally executed only when configured.
The default behavior is not to not evict an entity on cachePut.
Multiple cache region entities are evicted altogether.
an entity on region A mapped by id#1
an entity on region B also mapped by id#1
When the entity of A is put, the entity of B also is evicted because region A and region B are grouped and the cache key(id#1) is identical.
Additional context
An direct db update does not update cache entities, which leads data inconsistency between db and cache storage
Is your feature request related to a problem? Please describe.
Currently TTL ( version <= 1.2.0-RELEASE) is permanent (value: 0)
No option is available except 0.
Describe the solution you'd like
TTL is configurable as a config property. but default value remains as it is now.
Is your feature request related to a problem? Please describe.
Currently ttl of lock is set with a global ttl from a properties file
Hibernate sets timeout of SoftlockImpl to unlock items.
But the current feature does not unlock items with timeout set by Hibernate.
Describe the solution you'd like
In case of SoftLockImpl, HibernateArcusStorageAccess should expire a lock or set ttl to be expired immediately
Is your feature request related to a problem? Please describe.
Cache items of non-plan-text is hardly readable.
Some cases may needs items to readable.
Describe the solution you'd like
Make shape of items to be configurable
New Project request
groupId: com.github.kims-developergroup
https://issues.sonatype.org/browse/OSSRH-64363
Assigned maven repository path: https://repo1.maven.org/maven2/com/github/kims-developergroup/hibernate-arcus
After changing "CacheConcurrencyStrategy" READ_ONLY to READ_WRITE, getting entity occurs the exception below.
The cached entity is StandardCacheEntryImpl but current entity should be AbstractReadWriteAccess$Lockable
org.hibernate.HibernateException: Unable to perform afterTransactionCompletion callback: org.hibernate.cache.spi.entry.StandardCacheEntryImpl cannot be cast to org.hibernate.cache.spi.support.AbstractReadWriteAccess$Lockable
at org.hibernate.engine.spi.ActionQueue$AfterTransactionCompletionProcessQueue.afterTransactionCompletion(ActionQueue.java:990)
at org.hibernate.engine.spi.ActionQueue.afterTransactionCompletion(ActionQueue.java:513)
at org.hibernate.internal.SessionImpl.afterTransactionCompletion(SessionImpl.java:2404)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.afterTransactionCompletion(JdbcCoordinatorImpl.java:454)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.afterCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:203)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$400(JdbcResourceLocalTransactionCoordinatorImpl.java:40)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:283)
at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:101)
at hibernate.CollectionCacheTest.testCollectionCache_whenCollectionCacheIsPut_thenCollectionCacheShouldBeHitForTheNextGet(CollectionCacheTest.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassCastException: org.hibernate.cache.spi.entry.StandardCacheEntryImpl cannot be cast to org.hibernate.cache.spi.support.AbstractReadWriteAccess$Lockable
at org.hibernate.cache.spi.support.EntityReadWriteAccess.afterInsert(EntityReadWriteAccess.java:85)
at org.hibernate.action.internal.EntityInsertAction.cacheAfterInsert(EntityInsertAction.java:257)
at org.hibernate.action.internal.EntityInsertAction.doAfterTransactionCompletion(EntityInsertAction.java:239)
at org.hibernate.engine.spi.ActionQueue$AfterTransactionCompletionProcessQueue.afterTransactionCompletion(ActionQueue.java:983)
... 23 more
When changing CacheConcurrencyStrategy, regionName should be modified together not to reuse same cache items
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.