使用Hibernate作为ORM机制的Web应用程序中的L1和L2缓存之间有什么区别? [英] What's the difference between L1 and L2 caches in web-applications with Hibernate as ORM mechanism?

查看:77
本文介绍了使用Hibernate作为ORM机制的Web应用程序中的L1和L2缓存之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想要一些有关使用L1缓存和L2缓存的标准用途的一般信息.

I just want some general info about standard purpose of using L1 cache and L2 cache.

我很好奇,因为我正在研究将兵马俑作为第二级缓存的系统,而我发现它也具有第一级缓存.

I'm curious because I'm investigating the system with terracotta as 2nd level cache and I've found that it also has 1st-level cache.

推荐答案

L1缓存是每个Hibernate会话中都存在的缓存,并且该缓存不在线程之间共享.该缓存利用了Hibernate自己的缓存.

L1 Cache is the cache that exists per Hibernate session, and this cache is not shared among threads. This cache makes use of Hibernate's own caching.

L2高速缓存是一种可以在Hibernate会话之后生存的高速缓存,并且可以在线程之间共享.对于此缓存,您可以使用Hibernate随附的缓存实现(例如EHCache)或JBossCache2

L2 Cache is a cache that survives beyond a Hibernate session, and can be shared among threads. For this cache you can use either a caching implementation that comes with Hibernate like EHCache or something else like JBossCache2

这篇关于使用Hibernate作为ORM机制的Web应用程序中的L1和L2缓存之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆