Keywords:Aldsp Liquid Data Integration optimistic lock
For more information about aldsp (BEA AquaLogic Data Services platformbea AquaLogic Data Services Platform), visit: http://dev2dev.bea.com.cn/products/aqudtpt/index1.html
1. You can set the properties of dataservices to control whether updates are allowed.
2. SDO uses Optimistic Locking to update relational data to avoid conflicts. When data is retrieved, no lock is applied to the data. When update is required, an optimistic lock is applied to the data.
3. There are three use strategies for Optimistic Locking:
LProjected: This is the default attribute. With this option, the SDO Data graph and the elements of the data source are checked on a 1-to-1 basis to check the "updatability" of the data ". The SQL statement generated by this option is as follows:
Update rtlcustomer. CustomerSet default_ship_method =?
Where customer_id =? And first_name =? And last_name =? And customer_since =? And email_address =? And telephone_number =? And SSN =? And birth_day =? And default_ship_method =? And email_notification =? And online_statement =? And login_id =?
This is the most complete update option, and each field must be checked.
There are two situations during update:
(1) With this option, if the S1 dataset is obtained during the update and the original option in the database is S1. during the update, the data can be updated normally without errors.
Status |
Client SDO Dataset |
Data Source SDO Dataset |
Original Status |
Field 1 =A, Field 2 =B,... |
Field 1 =A, Field 2 =B... |
Client update |
Field 1 =A1, Field 2 =B... |
|
Updated |
|
Field 1 =A1, Field 2 =B... |
(2) If the client obtains the data set S1 and the original data S1 in the database is updated to S2 during the processing of the client, when the client submits the update of S1, it will throw an exception and cannot be updated. The exception is Optimistic Locking failure and update.
Status |
Client SDO Dataset |
Data Source SDO Dataset |
Original Status |
Field 1 =A, Field 2 =B... |
Field 1 =A, Field 2 =B... |
Client update |
Field 1 =A1, Field 2 =B... |
|
The database is updated by other programs. |
|
Field 1 =A, Field 2 =B2... |
Update failed because client Field 2 = B and database Field 2 = b2. |
LUpdated: Compared with projected, the updated option does not check whether all other fields are consistent with those in the result set. It only checks whether the updated fields are consistent with the submitted result set of the client, reduces the number of Checked fields.
Update rtlcustomer. CustomerSet default_ship_method =?
Where customer_id =? And default_ship_method =?
Selected Fields: The selected field is used to check the updatability, which is much more flexible than the previous two cases.
Update rtlcustomer. CustomerSet default_ship_method =?
Where customer_id =? And version_id =?
(1) If "enable Optimistic Locking" is not specified for any field, it can be updated even if the updated field is modified by an external program before the DSP is updated.
(2) If "enable Optimistic Locking" is set for some fields, the system checks whether these fields are updated by other external programs before the update. If the fields are updated, this update will fail.
*Version_id =?This is an implicit column for Optimistic Locking of some databases. In this case, if the updated field is modified by an external program, the update will fail.
Other articles about aldsp:
AquaLogic Data Services Platform demo tutorial
Practice: Configure excel as a data source in AquaLogic Data Service Platform
Bea and IBM joint specifications: commonj Introduction
Dynamic Data Table Access Solution in aldsp