0
votes

We want to use the redisson-hibernate project https://github.com/redisson/redisson/tree/master/redisson-hibernate to support redis 2nd level cache.

I tested redisson-hibernate module in multiple containers by using same Redis database. We use same database in the same Redis. But it doesn't share same data. Java application in the first container doesn't see updates of the records made by Java application in the second container. Every Java application have own version of the records.

Does Redisson Hibernate Cache Module can share same data in multiple containers?

Our redisson.yaml file contents:

singleServerConfig:
  idleConnectionTimeout: 10000
  connectTimeout: 10000
  timeout: 3000
  retryAttempts: 3
  retryInterval: 1500
  password: null
  subscriptionsPerConnection: 5
  clientName: null
  address: "redis://127.0.0.1:6380"
  subscriptionConnectionMinimumIdleSize: 1
  subscriptionConnectionPoolSize: 50
  connectionMinimumIdleSize: 24
  connectionPoolSize: 64
  database: 0
  dnsMonitoringInterval: 5000
threads: 16
nettyThreads: 32
codec: !<org.redisson.codec.FstCodec> {}
transportMode: "NIO"

We use hibernate for interacting with the postgresql database, it's our hibernate connection properties file contents:

hibernate.connection.url=jdbc:postgresql://localhost:5439/testdb
hibernate.connection.username=testdb
hibernate.connection.password=testdb567
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.pool_size=10
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.transaction.factory_class=org.hibernate.transaction.JDBCTransactionFactory
hibernate.current_session_context_class=thread
hibernate.show_sql=true
hibernate.cache.region.factory_class=org.redisson.hibernate.RedissonRegionFactory
hibernate.cache.use_query_cache=true
hibernate.cache.use_second_level_cache=true
hibernate.cache.redisson.fallback=true
hibernate.cache.redisson.config=redisson.yaml
1

1 Answers

0
votes

Yes, it does. It's the purpose of the module.

Java application in the first container doesn't see updates of the records

You might connected to the same Redis but different database. If this option is defined.

Every Java application have own version of the records.

That's impossible in Redis.

Could you describe your application structure and Redis setup?