‎2006 Dec 07 7:50 PM
What are the lock modes in Lock object ?
what are the divfferences between
Exclusive , cumulative
Shared
Exclusive , not cumulative
Could any body explain what happens in each table lock ?
How the lock consists ?
‎2006 Dec 07 7:56 PM
Please find complete details in the below link,
http://help.sap.com/saphelp_nw04s/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm
Regards
Kathirvel
‎2006 Dec 07 8:04 PM
Hi Samkumar,
Types of locks
You can lock the table or record by using following types of locking:
<b>1) Exclusive (E)</b> the locked data can only be displayed or modified by single user i.e the owner of the object. Access to other users is denied.
<b>2) Shared (S)</b> several users can access the same record simultaneously, but only in display mode and except the first one, who has asked for the data in update mode.
<b>3) Exclusive not cumulating (X)</b> it is similar to exclusive lock. It allows only a single user access. E can be called several times from the same transaction. In contrast, a lock type X can be called only once during the transaction. Any other call for this lock is rejected.
<b>Activation of Lock Object</b>
1) When you activate the lock object, the functions are automatically generated. And these are ENQUEUE-EZN and DEQUEUE-EZN. EZN is name of the lock object.
2) While ENQUEUE is used in program to set the code over the selected data depending upon the lock object arguments. DEQUEUE is used to release the lock.
Thanks,
Vinay
‎2006 Dec 08 2:21 AM
HI,
<b>Shared lock - S (Shared)</b> Several users (transactions) can access locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock set on an object that already has a shared lock will be rejected.
<b>Exclusive lock - E (Exclusive)</b> An exclusive lock protects the locked object against all types of locks from other transactions. Only the same lock owner can reset the lock (accumulate).
<b>Exclusive but not cumulative lock - X (eXclusive non-cumulative)</b> Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. Each further lock request will be rejected.
<b>Optimistic lock- O (Optimistic)</b> Optimistic locks initially behave like shared locks and can be converted into exclusive locks
Raja T
‎2006 Dec 08 3:45 AM
Hi,
The lock mode controls whether several users can access data records at the same time. The lock mode can be assigned separately for each table in the lock object. When the lock is set, the corresponding lock entry is stored in the lock table of the system for each table.
Access by more than one user can be synchronized in the following ways:
<b>Exclusive lock:</b> The locked data can only be displayed or edited by a single user. A request for another exclusive lock or for a shared lock is rejected.
<b>Shared lock:</b> More than one user can access the locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock is rejected.
<b>Exclusive but not cumulative:</b> Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. All other lock requests are rejected.
Pls. reward points for all helpful answers.
‎2006 Dec 08 4:39 AM
hi
good
Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
SAP Provide three type of Lock objects.
- Read Lock(Shared Locked)
protects read access to an object. The read lock allows other transactions read access but not write access to
the locked area of the table
- Write Lock(exclusive lock)
protects write access to an object. The write lock allows other transactions neither read nor write access to
the locked area of the table.
- Enhanced write lock (exclusive lock without cumulating)
works like a write lock except that the enhanced write lock also protects from further accesses from the
same transaction.
You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
Technicaly:
When you create a lock object System automatically creat two function module.
1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
You have to use these function module in your program.
thanks
mrutyun^
‎2006 Dec 08 8:42 AM
Hi Sam,
The lock modes u specified are
exclusive - This is a lock when u specify the data can be used only by this
operation and no other will have data access..
shared - in this lock everyone will be given default read access but only one can have write access at a time..
‎2006 Dec 11 8:45 AM
HI
Lock objects are used to synchronize access to the same data by more than one program.
The lock mode controls whether several users can access data records at the same time. The lock mode can be assigned separately for each table in the lock object. When the lock is set, the corresponding lock entry is stored in the lock table of the system for each table.
There are three types of lock modes
1.Exclusive
2.Shared
3.Exclusive not cummulative
Exclusive lock: The locked data can only be displayed or edited by a single user. A request for another exclusive lock or for a shared lock is rejected.
Shared lock: More than one user can access the locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock is rejected.
Exclusive but not cumulative: Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. All other lock requests are rejected.
please go through these links:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/af/22ab01dd0b11d1952000a0c929b3c3/frameset.htm</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eeb2446011d189700000e8322d00/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eeb2446011d189700000e8322d00/frameset.htm</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eebf446011d189700000e8322d00/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eebf446011d189700000e8322d00/frameset.htm</a>
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eed9446011d189700000e8322d00/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eed9446011d189700000e8322d00/frameset.htm</a>
Regards,
Gunasree.
‎2006 Dec 12 6:22 AM
hi
<b>Lock Objects</b>
In a system where many users can access the same data, it becomes necessary to control the access to the data. In R/3 system this access control is built-in on database tables. Developers can also lock objects over table records.
To lock an object you need to call standard functions, which are automatically generated while defining the lock object in ABAP/4 dictionary. This locking system is independent of the locking mechanism used by the R/3 system. This mechanism also defines LUW i.e. Logical Unit of Work. Whenever an object is locked, either by in built locking mechanism or by function modules, it creates corresponding entry in global system table i.e. table is locked. The system automatically releases the lock at the end of transaction. The LUW starts when a lock entry is created in the system table and ends when the lock is released.
<b>Types of locks</b>
You can lock the table or record by using following types of locking:
<b>Exclusive (E)</b> the locked data can only be displayed or modified by single user i.e the owner of the object. Access to other users is denied.
<b>Shared (S)</b> several users can access the same record simultaneously, but only in display mode and except the first one, who has asked for the data in update mode.
<b>Exclusive not cumulating (X)</b> it is similar to exclusive lock. It allows only a single user access. E can be called several times from the same transaction. In contrast, a lock type X can be called only once during the transaction. Any other call for this lock is rejected.
<b>Activation of Lock Object</b>
When you activate the lock object, the functions are automatically generated. And these are ENQUEUE-EZN and DEQUEUE-EZN. EZN is name of the lock object.
While ENQUEUE is used in program to set the code over the selected data depending upon the lock object arguments. DEQUEUE is used to release the lock.
While creating you can Select <b>secondary tables</b>, if any, linked by foreign key relationship.Fields for the lock objects. This option allows you to select fields for objects (R/3 system allows locking up to record level). Lock object argument are not selected by user but are imposed by the system and includes all the primary keys for the table.
‎2006 Dec 12 7:06 AM
Hello,
SAP help on lock objects.
http://help.sap.com/saphelp_nw04s/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm
Regards,
Shehryar Dahar