Hibernate first-level cache and level two cache

Source: Internet
Author: User
Tags object object

Hibernate cache: Session cache is transaction level cache, session closed, cache is automatically destroyed, developer does not manage, hibernate management, save, update, Saveoorupdate, lock, load, The list automatically stores the data in the first-level cache, and Get,load,list automatically takes the data from the primary cache, invoking evict (object object) and clear () to clean up the cache.

Hibernate level Two cache: the Sessionfactory cache is a process-level cache, implemented by a cache plug-in, such as Oscache, that provides support for Hibernate query caching, which is managed by the developer through configuration management such as whether to enable level two cache, specify which level of two cache to use, Specifies which domain enables level two, as well as the cache policy, the physical media that holds the data can be memory or hard disk, infrequently modified data, unimportant data, data that is not concurrently accessed, and data that is shared with other applications fit into the level two cache.

Hibernate first-level cache and level two cache

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.