Session usage in hibernateThe main function of Session is to create, read, and delete mapped object class instances. The instance may exist in the following three States:Temporary status (transient): No persistence, not associated with any
Difference between session. Get and session. Load1. for the get method, Hibernate checks whether the data corresponding to this ID exists. First, it searches in the session cache and then in the second-level cache. If no data exists, it queries the
Hibernate statusSave, persist, update, saveorupdte, merge, flush, lock, and object states of Hibernate
Save hibernate
Hibernate provides too many methods for Object Storage. There are many differences between them. Let's take a closer look at the
Let's talk about it this time.Hibernate3.2The difference between get and load methods when loading data in sessions. In fact, there are a lot of discussions on the Internet, which can be vague or difficult to comprehend, making it difficult for many
Hibernate, as a framework for dealing with database data, will naturally design operational data efficiency issues. For data that is frequently operated, cache policies are an important means to improve its performance, however, the Hibernate
Concept of cache:
Memory space occupied by Java object attributes (usually set-type attributes. If an object occupies a large amount of memory, it is called a heavyweight Object. If the object memory is small, it is called a lightweight object.
1. 1. Temporary statusA Java object that opens up memory space by the new command, which is usually a familiar Java object.such as: Student stu = new Student ();Instantaneous object features:(1) not associated with session cache instance(2) There
Performance optimization1. Note the use of session.clear (), especially in the continuous pagingA) traversing a large set, traversing the MSG, and taking out the object containing the sensitive typefaceb) Another form of memory leak (//interview
Initial Learning Hibernate three states, listen to some indefinitely, then gradually understand, it slowly has its own understanding, and through a small example can be more clear about these three states. Here is my summary. 1,hibernate three
1, Hibernate's level two cache mechanism? A, hibernate cache what is the roleHibernate is a persistent layer framework that frequently accesses physical databases to reduce the frequency of application access to databases, thereby improving the
Hibernate common face question hibernate working principle and why use?
How does hibernate work and why should I use it?
Read and parse the configuration file
Read and parse mapping information, create Sessionfactory
Object state and first level cache:(1) Status Description:Hibernate requires three states: Transient , persistent , and off -state.State:Transient state: Transient,session does not have cached objects and the database does not have corresponding
1. You can overload the method to specify the configuration fileNew Annotationconfiguration (). Configure ("hibernate.xml"). Buildsessionfactory ();So the reading is hibernate.xml but generally not recommended to modifyGetcurrentsession refers to a
excerpt from the network: The first level cache in Hibernate is in the form of a map, the key is the primary key, and value is the object, so its generics are mapobject>, The generics of key are serializable because the primary key can be
The hibernate as a lightweight ORM framework that is now more prevalent, has been popular in the country since 2003 and is now dominant in the persistence layer. Although the rich and flexible hql and the object of the criteria query, the
Mainly from the following more than 10 aspects of Hibernate summary, including the hibernate of the search method, hibernate the status of the object, hibernate of the 3 kinds of search strategies, which are applicable to the situation, ORM solve
The main difference is whether to delay loading.
Load methodThe database is not accessed immediately, and the Load method returns an uninitialized proxy object when the record you are trying to load does not exist.
Get method
Always access the
(Source: http://xiexiejiao.cn/hibernate/hibernate-performance-optimization-b.html)
Hibernate is the author used more than 5 years of excellent ORM framework, although the use of 5 years, but the author is not sure to say that their true sense of
1. The clear () method of the sessionHibernate searches the database for Get or load records, or go to the session cache to find the corresponding data, if there is no record in the cache, then go to the corresponding databases query,If there is a
Warning cannot send session cookie-headers already sent... Problem Solving (problem caused by UTF-8 BOM of PHP)
I am used to using edit plus for PHP programming, so sometimes some unknown errors may occur, which is very troublesome;Recently, the
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.