vlad wrote:
When you get:
Quote:
A collection with cascade=\"all-delete-orphan\" was no longer referenced by the owning entity instance
It means that you have assigned a new collection Object reference instead of adding/removing elements from the Hibernate managed collection.
For more details of how this association should look like, check out
this article.I think I've carefully studied and followed the tutorial at least 5 times. I don't think I've missed anything, but I'm getting
Code:
2017-09-08T19:07:49.879110+00:00 app[web.1]: Caused by: org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given; please either disable second level cache or set correct region factory using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
2017-09-08T19:07:49.879114+00:00 app[web.1]: at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:452) ~[hibernate-core-5.2.10.Final.jar!/:5.2.10.Final]
2017-09-08T19:07:49.879115+00:00 app[web.1]: at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:889) ~[hibernate-core-5.2.10.Final.jar!/:5.2.10.Final]
after googling, suggestion was to set use_second_level_cache to false which I think totally defeat the purpose.
I also found suggestion that I think is more appropriate by setting
Code:
spring.jpa.properties.hibernate.cache.region.factory_class="net.sf.ehcache.hibernate.EhCacheRegionFactory"
but got another exception says
Code:
org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name ["net.sf.ehcache.hibernate.EhCacheRegionFactory"] as strategy [org.hibernate.cache.spi.RegionFactory]
I also tried org.hibernate.cache.ehcache.EhCacheRegionFactory and getting the same exception except class name
I do have hibernate-ehcache in my pom
I'm sorry, but I really can't find other solution. Thank you