quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.4k stars 2.57k forks source link

Infinispan cache annotations with Panache-Entity #29254

Open wernert75 opened 1 year ago

wernert75 commented 1 year ago

Describe the bug

The new cache annotations for infinispan works fine. But in case there is an JPA - Action (e.g. findById) then the method seems to be hanging. No response is submitted to the client.

Expected behavior

Infinispan Cache-Annotations should work, even if a JPA - action invoked.

Actual behavior

If an JPA - action is invoked within a method, annotated witch CacheResult the method is not working. No error or exception is thrown.

How to Reproduce?

See attached reproducer. Works out of the box with DevServices.

you could test: curl localhost:8080/score/nocache/3 (Works DB-Access, no cache-Annotation) curl localhost:8080/score/mock/300 (Works: No DB-Access, Cache-Annotation) curl localhost:8080/score/3 (Don't work DB-Access, Cache-Annotation) sandbox.zip

Output of uname -a or ver

Darwin MacBook-Air-2.fritz.box 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:30 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103 arm64

Output of java -version

openjdk version "17.0.1" 2021-10-19 LTS OpenJDK Runtime Environment Zulu17.30+15-CA (build 17.0.1+12-LTS) OpenJDK 64-Bit Server VM Zulu17.30+15-CA (build 17.0.1+12-LTS, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.14.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.5 (3599d3414f046de2324203b78ddcf9b5e4388aa0) Maven home: /opt/apache-maven Java version: 17.0.1, vendor: Azul Systems, Inc., runtime: /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home Default locale: de_DE, platform encoding: UTF-8 OS name: "mac os x", version: "13.0.1", arch: "aarch64", family: "mac"

Additional information

No response

quarkus-bot[bot] commented 1 year ago

/cc @FroMage, @gwenneg, @karesti, @loicmathieu, @wburns

karesti commented 1 year ago

Thanks for raising the issue! Opening a JIRA https://issues.redhat.com/browse/ISPN-14310

karesti commented 3 months ago

Caching SPI has been introduce here

https://github.com/quarkusio/quarkus/pull/39836

Might be worth testing this use case with Infinispan 15 and the caching annotations for the cache extension