spring-projects / spring-data-jpa

Simplifies the development of creating a JPA-based data access layer.
https://spring.io/projects/spring-data-jpa/
Apache License 2.0
3.02k stars 1.42k forks source link

use @Postcontruct jpa first level cache didn't work #3596

Closed chixiaopao closed 3 months ago

chixiaopao commented 3 months ago

When I use a for loop in the method annotated by Postcontruct to query the value in the database. After the first query value, then manually modify the database value, the result of the second loop query is not the value in the cache.

I think the jpa first-level cache should take effect, but I don’t know why it failed. Can anyone give me an answer?

thanks

christophstrobl commented 3 months ago

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. We prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.