Hibernate NoCacheRegionFactoryAvailableException

后端 未结 5 2106
自闭症患者
自闭症患者 2021-02-20 04:24

I\'m getting a bizarre Hibernate exception that I can\'t explain. It\'s telling me that I\'m using 2nd level cache, but no where in hibernate.cfg.xml do I specify a

5条回答
  •  囚心锁ツ
    2021-02-20 05:23

    I also received this error and took me a while to track down. At one point we were going to have multiple cache regions, but in the end decided we were just going to have one cache pool.

    When we merged that change into an older branch - we still had an entity with the old strategy of a cache pool per entity:

    @Entity
    @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region="tableRegion")
    @Table(name = "table")
    public class table {
    

    By removing the Cache annotation - it resolved the org.hibernate.cache.NoCacheRegionFactoryAvailableException:

    @Entity
    @Table(name = "table")
    public class table {
    

    Figured I'd post in case anyone else had a similar situation

提交回复
热议问题