‎2006 Jul 24 7:39 PM
Hi
I understand that somehow I would have to create locks to avoid table collision when updating tables by several users. What happens if I don't do that, meaning while one user is writing and updating a table and another is do in the same to the same table? Will the program give a runtime error? Are all the users running the program will run into the runtime error?
Thanks,
RT
‎2006 Jul 24 7:47 PM
Rob, there will be no ABAP runtime error if you don't use the locks, but you will have data inconsistancies. For example, say user 1 bring up a record of the ztable, and needs to change the description, say field number 2. User goes and gets a cup of coffee without saving, User 2 enters the transaction and wants to change the description of the same record that user 1 has open, user 2 saves and exits. User 1 comes back and saves the changes, the description field has now been updated overwriting the value that user 2 had previously changed. You can see the importance of locking, right?
Regards,
Rich Heilman
‎2006 Jul 24 7:42 PM
Hi Rob,
This is done to aviod any inconsistency while accessing the database.
Well locking the table ensures the basic ACID properties of the DB.
A--> Atomicity
C--> Consistency
I--> Isolation
D--> Durabilty
Trying to update the database table at the same time might result into inconsistency.
DB_SQL_ERROR runtime might be issued.
Never seen it personally though!
Also refer to
http://help.sap.com/saphelp_nw04s/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/content.htm
Hope that helps!
Regards,
Tanveer.
<b>Please mark helpful answers</b>
‎2006 Jul 24 7:46 PM
Hi Rob,
The SAP system is equipped with a special lock mechanism that synchronizes access to data on the database. The purpose of the lock mechanism is to prevent two transactions from changing the same data on the database simultaneously.
Also please check this link.
http://help.sap.com/saphelp_nw04s/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/content.htm
Regards,
Ferry Lianto
‎2006 Jul 24 7:47 PM
Rob, there will be no ABAP runtime error if you don't use the locks, but you will have data inconsistancies. For example, say user 1 bring up a record of the ztable, and needs to change the description, say field number 2. User goes and gets a cup of coffee without saving, User 2 enters the transaction and wants to change the description of the same record that user 1 has open, user 2 saves and exits. User 1 comes back and saves the changes, the description field has now been updated overwriting the value that user 2 had previously changed. You can see the importance of locking, right?
Regards,
Rich Heilman