软件锁定的缓存条目已被基础Ehcache过期

Joe*_*Joe 6 caching hibernate jpa ehcache second-level-cache

Hibernate 3.3.x,ehcache 2.2.x

当我尝试一次发布大量用户时,会发生以下错误.知道为什么会发生这种情况以及如何纠正这个问题?有没有办法在批量加载用户之前禁用此缓存,如果是这样,我应该怎么做?

17:17:50,140 WARN [AbstractReadWriteEhcacheAccessStrategy] Cache
persistence.unit:unitName=my.ear/my-ejb-1.0.0.jar#my.com.mycompany.User.phones Key com.mycompany.User.phones#9915 Lockable : null

A soft-locked cache entry was expired by the underlying Ehcache.
If this happens regularly you should consider increasing the cache timeouts and/or capacity limits
Run Code Online (Sandbox Code Playgroud)

EDIT1:

当我尝试通过JPA调用将大量用户批量加载到数据库中时,会发生此错误.我没有通过拆卸钩子关闭缓存管理器.

Bin*_*mas 2

从描述来看,实体的二级缓存似乎已满,并且其中一些实体被过早地从底层 ehcache 中逐出。正如文档中所述,您在批量插入期间是否定期flush休眠?clearSession