Hi Rob,
The problem I encountered is this, create two transactions A and B successively and then operate the same entity at the same time. One update, one query, I observed that the cache was also cleared after update transaction A was submitted. Then transaction B performs a query, but it gets the old data and adds the old data to the cache, and subsequent queries always get the old data.
If transaction A is a delete operation, the problem will cause the ebean to continue to throw EntityNotFoundException: Bean not found during lazy load or refresh. Because the old data that has been deleted is always stored in the L2 cache.
I use mysql. I think what I encountered is a mysql-specific problem.
I think it may be a transaction isolation problem, but I am not sure whether ebean should take some action to solve this problem. Because the old data in the L2 cache will always cause program errors.
This problem is very occasional, I tried to provide a test case, please see the 'textMysqlLazyLoad' case in this project:
Thanks.