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.
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
JPA/Hibernate ( ORM) L1 , , , . ( ). JPA EntityManager.
L2 - () . /, , , , . JPA EntityManagerFactory.
GaryF , :-) , :
: "", , . , 3 , , . "" .
: "" , Infinispan. , , , , ..
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.
Session