2009 Jan 02 11:10 AM
Hi,
Just need to clear a small confusion.
I am updating the custom table in my program. In that After the Update query i am checking the sy-subrc condition and if it success i am doing COMMIT WORK.
i just want to know do i need to call explicitely the DEQUEUE function module for releasing locks after the commit work.
Also,
if the sy-subrc fails i am doing ROLLBACK WORK. After that i am not using the DEQUEUE function module as the SCOPE parameter of the the function module is by default 2 and being so the locks will be removed automatically.
Please guide me in case of commit work.
Regards,
Anuja
2009 Jan 16 10:15 AM
Hi ,
Database systems do not usually provide commands for explicitly setting or releasing locks.
Therefore, prior to executing the database operation, database locks are set implicit when one of
the Open-SQL-statements SELECT, INSERT, UPDATE, MODIFY, DELETE
The updated rows are finally included in the table in the next database commit.
Up until this point, they can still be removed by a database rollback.
The statement UPDATE sets a database lock until the next database commit or rollback.
The statement COMMIT WORK completes the current SAP LUW and opens a new one.
In principle, one type of lock is enough to control conflicting data accesses. However, to achieve a greater degree of parallel running among transactions, database systems use several types of locks.
Using Lock Objects you can programatically define Locks.
For a detailed understanding for the differences between(Database and SAP Locks) them and the creation of Lock Objects :
http://help.sap.com/saphelp_nw04/helpdata/EN/e5/de86d835cd11d3acb00000e83539c3/frameset.htm
http://help.sap.com/saphelp_webas630/helpdata/en/c7/2d7037ecc92a7ee10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_webas630/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/frameset.htm
Regards,
Radhika.
Hi,
Just need to clear a small confusion.
I am updating the custom table in my program. In that After the Update query i am checking the sy-subrc condition and if it success i am doing COMMIT WORK.
i just want to know do i need to call explicitely the DEQUEUE function module for releasing locks after the commit work.
Also,
if the sy-subrc fails i am doing ROLLBACK WORK. After that i am not using the DEQUEUE function module as the SCOPE parameter of the the function module is by default 2 and being so the locks will be removed automatically.
Please guide me in case of commit work.
Regards,
Anuja
2009 Jan 02 11:13 AM
ENQUEUE and DEQUEUE are not physical locks on database , they are logical locks calling commit and then dequeuing is better way to do.
2009 Jan 02 11:21 AM
Locks will be automatically released once the execution of the program/transaction is completed.
But as a better practice, the records should be unlocked once the updates are completed, so the records will be available as soon as possible for future updates if there are any.
2011 Jan 27 10:13 AM
The automatic release of SAP locks is depending on the SCOPE parameter of the enqueue function modules. See doku for details: http://help.sap.com/saphelpnw04/helpdata/DE/23/edae617ba64e85bd4997f25c77eb1f/content.htm
2009 Jan 16 10:15 AM
Hi ,
Database systems do not usually provide commands for explicitly setting or releasing locks.
Therefore, prior to executing the database operation, database locks are set implicit when one of
the Open-SQL-statements SELECT, INSERT, UPDATE, MODIFY, DELETE
The updated rows are finally included in the table in the next database commit.
Up until this point, they can still be removed by a database rollback.
The statement UPDATE sets a database lock until the next database commit or rollback.
The statement COMMIT WORK completes the current SAP LUW and opens a new one.
In principle, one type of lock is enough to control conflicting data accesses. However, to achieve a greater degree of parallel running among transactions, database systems use several types of locks.
Using Lock Objects you can programatically define Locks.
For a detailed understanding for the differences between(Database and SAP Locks) them and the creation of Lock Objects :
http://help.sap.com/saphelp_nw04/helpdata/EN/e5/de86d835cd11d3acb00000e83539c3/frameset.htm
http://help.sap.com/saphelp_webas630/helpdata/en/c7/2d7037ecc92a7ee10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_webas630/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/frameset.htm
Regards,
Radhika.
2011 Jan 27 9:49 AM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |