e_ddjava 2022-02-17 11:35 采纳率: 76.7%
浏览 9

hibernate 二级缓存 和 管理 session的错误

出现了这样 的报错
Caused by: org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:

  1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
  2. Shutdown the earlier cacheManager before creating new one with same name.
    The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]

在我测试openSession(); 是否为新的时候

  CustomerDao CC= new CustomerDao(); 
  CC.save(null);
  CC.save(null);
  CC.save(null);
  • 写回答

1条回答 默认 最新

  • piaoyiren 2022-02-17 11:39
    关注

    Another unnamed CacheManager already exists in the same VM.解决方法
    https://blog.csdn.net/xionglangs/article/details/71557290

    评论

报告相同问题?

问题事件

  • 创建了问题 2月17日

悬赏问题

  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能