I've created a table, named PERSONAL_INFO, with following structure in Oracle 8i db:
Table : PERSONAL_INFO
FIELDS TYPE
=============================
TIMESTAMP DATE
PERSONAL_ID NUMBER(10)
ADDRESS VARCHAR2(50)
etc.....
There is an application allow users to browse, edit, and delete this table's data.
I want to make sure that concurrent edit is not allowed.
So, I've created an additional TIMESTAMP field for each record. When insert a new record, it will stored the db system time (MM/DD/YYYY hh:mm:ss).
I've also created some stored proc. to retrieve the data based on the user permission and some triggers depended on the events of INSERT, UPDATE, and DELETE.
While user is editing the record from PERSONAL_INFO and press the SAVE buttom, the application will call the UPDATE stored proc. and the UPDATE trigger will comparing the memory's TIMESTAMP and the db's TIMESTAMP. If not the same, return error message to user and abort the UPDATE process.
The accuracy of this approach is in 1 sec. level. For example, if num. of users is over 100,000 and num. of transcation per min. is over 10,000, the risk of concurrent editing is so high.
In MS SQL Server, I know that it can define a field as a timestamp. The db will increment the timestamp value automatically if process any UPDATE, INSERT, and DELETE event. So, the risk of concurrent edit is very low.
My question :
Can anyone tell me any better solution for concurrent edit for Oracle?
Thanks,
Raymond Lee
Table : PERSONAL_INFO
FIELDS TYPE
=============================
TIMESTAMP DATE
PERSONAL_ID NUMBER(10)
ADDRESS VARCHAR2(50)
etc.....
There is an application allow users to browse, edit, and delete this table's data.
I want to make sure that concurrent edit is not allowed.
So, I've created an additional TIMESTAMP field for each record. When insert a new record, it will stored the db system time (MM/DD/YYYY hh:mm:ss).
I've also created some stored proc. to retrieve the data based on the user permission and some triggers depended on the events of INSERT, UPDATE, and DELETE.
While user is editing the record from PERSONAL_INFO and press the SAVE buttom, the application will call the UPDATE stored proc. and the UPDATE trigger will comparing the memory's TIMESTAMP and the db's TIMESTAMP. If not the same, return error message to user and abort the UPDATE process.
The accuracy of this approach is in 1 sec. level. For example, if num. of users is over 100,000 and num. of transcation per min. is over 10,000, the risk of concurrent editing is so high.
In MS SQL Server, I know that it can define a field as a timestamp. The db will increment the timestamp value automatically if process any UPDATE, INSERT, and DELETE event. So, the risk of concurrent edit is very low.
My question :
Can anyone tell me any better solution for concurrent edit for Oracle?
Thanks,
Raymond Lee