micronaut-projects / micronaut-projects/micronaut-data
Hibernate Second Level Cache
- Dominant language
- Java
- Stars
- 482
- Forks
- 229
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 32
Description
### Expected Behavior
Fetch Entity only from hazelcast cache.
### Actual Behaviour
First Query database to Retrieve Entity and then Fetch that from cache.
`
14:02:41.187 [io-executor-thread-2] DEBUG o.h.c.s.s.AbstractReadWriteAccess#281 TraceId : Checking writeability of read-write cache item [timestamp='6796328713736192', version='0'] : txTimestamp='6796328800944128', newVersion='0'
14:02:41.187 [io-executor-thread-2] DEBUG o.h.c.s.s.AbstractReadWriteAccess#112 TraceId : Cache put-from-load
`
### Steps To Reproduce
1- Configure Hibernate lv2 cache with this config :

2- add dependency to build.gradle

3- annotate Entities this `@Cacheable` and `@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)`
### Environment Information
- Windows 10
- JDK 17 (Adoptium)
- Hazelcast 5.1.2
### Example Application
_No response_
### Version
3.4.2
Contributor guide
Research direction
Start with the Hibernate second-level cache configuration shown in the issue, the dependency in build.gradle, and the entities annotated with @Cacheable and READ_WRITE. Reproduce on JDK 17 with Hazelcast 5.1.2 and inspect the logged database query and cache put-from-load sequence; done means repeated entity fetches come from Hazelcast without the initial database query.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100