1

My application is running in multiple JVM instances (in separate docker containers).

The application uses hibernate (and spring-data-jpa) to access the single database (MySQL) instance.

Do I need to disable some hibernate cache (e.g. the first-level-cache for a hibernate session) to get that setup work?

Stephen King
  • 581
  • 5
  • 18
  • 31
t777
  • 3,099
  • 8
  • 35
  • 53

1 Answers1

2

Hibernate first level cache is enabled by default and there is no way to disable it.

But for second level cache you can use for example, Ehcache RMI Replicated Caching: http://www.ehcache.org/documentation/2.7/replication/rmi-replicated-caching

It provides a good solution for caching in multiple JVM environment.

Leo
  • 1,029
  • 4
  • 19
  • 40
  • Thx. I really do not need a second level cache. Is the built-in first level cache prepared for a multiple JVM environment or do I need to replace it? – t777 Apr 24 '18 at 16:00
  • 1
    Yes it prepared for multiple JVM, you can use it – Leo Apr 25 '18 at 01:09