Why does spring data jpa get inconsistent results from executing the find method after executing the save method and the find method executing the find method without executing the save method?

I opened the sql log, and
found that the find method was executed after the save was executed, but not the sql.

if find is executed directly, sql will be executed

Why is this? what is the principle? there is no explanation on the official website.


has solved
Autowired
private EntityManager entityManager;
entityManager.clear ();
just clear the cache
https://stackoverflow.com/que...

Menu