Book Image

Getting Started with Hazelcast

By : Matthew Johns
Book Image

Getting Started with Hazelcast

By: Matthew Johns

Overview of this book

Table of Contents (18 chapters)
Getting Started with Hazelcast
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Transparently caching others' data


Another very popularly used framework is Hibernate, used as an ORM (Object Relationship Mapper) layer, traditionally used to translate objects to and from a relational database table. While this goes against the distributed data philosophy we have been exploring with Hazelcast, we may have a legacy application that is currently using it. By adding a caching layer we can improve the scalability and performance of this application, however by enabling this cache layer we will be introducing a data consistency issue; to avoid this we would need an intelligent distributed cache, exactly like Hazelcast.

To enable the use of the cache layer, we must again include the appropriate hazelcast-hibernate-2.6.jar extension to the classpath. Additionally we need to turn on Hibernate's second level caching functionality and define the Hazelcast region-caching wrapper within its hibernate.cfg.xml configuration.

<hibernate-configuration>
  <session-factory>

...