Research on Hibernate-based das Implementation (4)

Source: Internet
Author: User
The company received the message from Bea.

Project objectives document

Data Access Service (DAS)

Text block. It contains the following content:

Optimistic Concurrency Control-Ability to detect and report update collisions when applying a change summary.

So I took a look at the implementation of hibernate locks and summarized them as follows:

1) pessi lock for Oracle/MySQL/ms SQL these three dialect, In the lockmode set. in the case of upgrade, select... is automatically generated... fro update; databases that do not support pessi lock do not have for udpate. For Sybase, you need to add the "Lock" field in the database, and then manually implement pessilock. 2) When the Opti lock2.1: Version method is saved, version = 0 is automatically set; when loading, the version field of this record is loaded; when updating, set version = 1... is automatically added .... where version = 0 can prevent 2nd class update loss problem 2.2: The timestamp method requires that the database field be Timestamp and can only be accurate to seconds, so in the case of concurrent ms, there may still be a problem. The 2.3 configuration method hibernate also provides another method. If the database already exists and there is no opti lock field, you can configure optimistic-lock. However, the implementation method is to take all the fields/or updated fields as conditions during update, which will affect performance.

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.