2

I am trying to do a POC on hibernate 2nd level cache with Apache Ignite. With this configuration I was able to make it work

spring.jpa.properties.hibernate.cache.use_second_level_cache=true
spring.jpa.properties.hibernate.cache.use_query_cache=true
spring.jpa.properties.hibernate.generate_statistics=false
spring.jpa.properties.hibernate.cache.region.factory_class=org.apache.ignite.cache.hibernate.HibernateRegionFactory
spring.jpa.properties.org.apache.ignite.hibernate.default_access_type=READ_ONLY


<dependency>
     <groupId>org.gridgain</groupId>
     <artifactId>ignite-hibernate_5.3</artifactId>
     <version>8.7.23</version>
     <exclusions>
         <exclusion>
             <groupId>org.hibernate</groupId>
             <artifactId>hibernate-core</artifactId>
         </exclusion>
     </exclusions>
 </dependency>

@Bean
@ConditionalOnMissingBean
public IgniteConfiguration igniteConfiguration(DiscoverySpi discoverySpi, CommunicationSpi communicationSpi) {
    IgniteConfiguration igniteConfiguration = new IgniteConfiguration();
    igniteConfiguration.setClientMode(clientMode);
    igniteConfiguration.setMetricsLogFrequency(0);

    igniteConfiguration.setGridLogger(new Slf4jLogger());

    igniteConfiguration.setDiscoverySpi(discoverySpi);
    igniteConfiguration.setCommunicationSpi(communicationSpi);
    igniteConfiguration.setFailureDetectionTimeout(failureDetectionTimeout);

    CacheConfiguration<String, ?> cc = new CacheConfiguration<>();
    cc.setName(“Entity1”);
    cc.setCacheMode(CacheMode.REPLICATED);

    CacheConfiguration<String, ?> cc1 = new CacheConfiguration<>();
    cc1.setName(“default-query-results-region”);
    cc1.setCacheMode(CacheMode.REPLICATED);

    CacheConfiguration<String, ?> cc2 = new CacheConfiguration<>();
    cc2.setName(“default-update-timestamps-region”);
    cc2.setCacheMode(CacheMode.REPLICATED);

    igniteConfiguration.setCacheConfiguration(cc);



    return igniteConfiguration;
}

I am testing this with external ignite node, but if the external ig node is restarted , I see the error when trying to access Entity1

"errorMessage": "class org.apache.ignite.internal.processors.cache.CacheStoppedException: Failed to perform cache operation (cache is stopped): Entity1; nested exception is java.lang.IllegalStateException: class org.apache.ignite.internal.processors.cache.CacheStoppedException: Failed to perform cache operation (cache is stopped): Entity1",

It looks like the issue is as reported here ,

Ignite Cache Reconnection Issue (Cache is stopped) https://issues.apache.org/jira/browse/IGNITE-5789

Are there any other way without restaring the client application we can make it work?

Updated all logs and attachments here

Tatha
  • 1,253
  • 2
  • 24
  • 42
  • 1
    IGNITE-5789 was fixed for Ignite 2.7 and should be in your 2.7.6 version. As I see, you use GridGain's hibernate module that might not work well with Ignite 2.7.6. Try to switch all ignite artifacts to GridGain 8.7.23 and see if the issue persists. Share logs from clients and servers if the problem is not solved. – dmagda Aug 26 '20 at 22:57
  • 1
    I have updated to all gridgain version , still seeing the issue. uploaded the logs in the mailing list https://lists.apache.org/list.html?user@ignite.apache.org – Tatha Aug 27 '20 at 15:33

0 Answers0