Reputation: 1933
When my server first loads, it initializes Hazelcast and have an instance.
At a later point, it initializes Hibernate's SessionFactory configured to use Hazelcast has 2nd level cache.
The result is having 2 components that initializes HZ instances.
My question is: Is there a way to pass HZ instance to SessionFactory?
Thank you!
Upvotes: 0
Views: 368
Reputation: 946
You can share your named hazelcast instance with Hibernate SessionFactory by using hibernate.cache.hazelcast.instance_name
Here is how to configure named hazelcast instance.
Config config = new Config();
config.setInstanceName( "my-named-hazelcast-instance" );
please check latest documentation for more info.
Upvotes: 1