Hibernate entity Object three states: Free State, persistent state, Free State.

Source: Internet
Author: User

The difference between Free State and Free State:

When a persistent object, out of hibernation cache management, it is in a free State, free objects and free objects The biggest difference is that the free object in the database may also have a corresponding record, but now this free object out of Hibernate cache management, The free object does not appear in the database with its corresponding data record

(1) Free State (Transient)

Characteristics:

① is not in the session cache and is not associated with any session instances.

② does not have a corresponding record in the database.

(2) Persistent State (persistent)

Characteristics

① is associated with the session instance in the cache of the session.

The ② has a corresponding record in the database.

(3) Free State (Detached)/off-tube status

Characteristics

① is not in the session cache and is not associated with any session instances.

The ② has a corresponding record in the database. (The precondition is that no other session instance deletes the record).

Hibernate entity Object three states: Free State, persistent state, Free State.

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.