What is the difference between L1 and L2 caches in web applications with Hibernate as an ORM mechanism?

I just need some general information about the standard purpose of using L1 cache and L2 cache.

I am curious because I am studying a terracotta system as a second level cache, and I found that it also has a 1st level cache.

+5
source share
4 answers

L1 Cache is a cache that exists in a Hibernate session, and this cache is not shared between threads. This cache uses Hibernate's own caching.

L2 - , Hibernate . , Hibernate, EHCache, - JBossCache2

+8

JPA/Hibernate ( ORM) L1 , , , . ( ). JPA EntityManager.

L2 - () . /, , , , . JPA EntityManagerFactory.

+2

GaryF , :-) , :

: "", , . , 3 , , . "" .

: "" , Infinispan. , , , , ..

+1

If Hibernate is something similar to NHibernate (it is, except vice versa), it Sessionis the first level cache. Except that this is not a cache in the general sense, but rather an identical card.

0
source

All Articles