Skip to content

Latest commit

 

History

History
 
 

docker-hibernate-2ndlevel-cache

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Hibernate 2nd Level Cache with Hazelcast

In this repository, you can find a sample implementation of hibernate 2nd level cache with hazelcast. You can also find detailed explanation at http://hazelcast.org/

Prerequisites

You should have installed Docker on your system.

By default "hibernate-core" added to project in "pom.xml" file as follows:

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.3.8.Final</version>
</dependency>

But project is also compatible with hibernate 3.X.X versions. You can change these entries accordingly.

How to Run Sample Application

1) Build project image using:
docker build -t hazelcast-2ndlevel-cache .
  1. Create database using:
docker run -it --rm  hazelcast-2ndlevel-cache bash "./run.sh"

Sample Use Case

Execute the following commands in ManageEmployee. You will see that an employee will be created at the second session but you can see it in the first session too.
[1. session]command: list
[1. session]command: change
[2. session]command: add
Id: 1
First Name: Name
Last Name: Surname
Salary: 100
[2. session]command: close
[2. session]command: change
[1. session]command: list
Id: 1 First Name: Name Last Name: Surname Salary: 100