Lock Object control (concurrence)
Hi all,
How can we manage concurrence in VC?. For example, how can I avoid multiple users maintaining the same table in VC?.
I can run a data service with the "start" connector in order to place a lock object, but how can I run a data service when the iview is closed ?.
Best Regards,
Carlos.
Hi
This should be handled by the DB/R3 where possible, VC can not do it. You could create a temporary table which holds a value when a specific table is being edited and the VC app will check this table before allowing users to edit.
Similar Messages
-
What are the lock modes in Lock object
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 ?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. -
Lock object problem on custom table
Hi all.
I am having a bit of an issue with a lock object on a home made table. We're using the UWL and a custom IView to display an extended invoice. No problem releasing the workitem lock, just the table entry lock.
I can see the lock in SM12. Tried dequeue/dequeue all RFCs from backend, no luck.
The lock is set from a custom RFC. This RFC succesfully releases the lock when used in SAPGUI, and we have an RFC enabled wrapper around it. However, once used in the portal, the locks aren't released. My suspicion is that it has to do with sessions and I can't see a way to control that since dynpro uses a connection pool IIRC.
Anyone have any ideas on how to solve this?Small correction if you are not aware. Do not create your custom tables in APPS schema? Custom tables are supposed to created in custom schema such as XXPO and a synonym created for the table in APPS schema.
When creating an EO, you do not need to provide the schema name. You would need to enter only the table name.
Hope this helps. -
Hi,
Iam implementing some screens. I created some lock objects. I could not able to under these concepts. Even though I studied some documents, i could not get the below concepts. can anybody explain.
1. what is the enqueue mode
2. what is the scope
3.what is the wait parametrs
rgds
p.kpHi paluri,
Info taken from standard sap help.
1. Enqueu Mode.
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:
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.
2. Scope
Parameter _SCOPE controls how the lock or lock release is passed to the update program (see The Owner Concept for Locks). You have the following options:
_SCOPE = 1: Locks and lock releases are not passed to the update program. The lock is removed when the transaction is ended.
_SCOPE = 2: The lock or lock release is passed to the update program. The update program is responsible for removing the lock. The interactive program with which the lock was requested no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
_SCOPE = 3: The lock or lock release is also passed to the update program. The lock must be removed in both the interactive program and in the update program. This is the standard setting for the DEQUEUE function module.
3. WAIT
The ENQUEUE function module also has the parameter _WAIT. This parameter determines the lock behavior when there is a lock conflict.
You have the following options:
Initial value: If a lock attempt fails because there is a competing lock, the exception FOREIGN_LOCK is triggered.
X : If a lock attempt fails because there is a competing lock, the lock attempt is repeated after waiting for a certain time. The exception FOREIGN_LOCK is triggered only if a certain time limit has elapsed since the first lock attempt. The waiting time and the time limit are defined by profile parameters.
regards,
amit m. -
Needed information on lock objects
needed information regarding lock objects
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.
regards
Nagesh.Paruchuri -
Finding locked objects in design repository?
Does anyone know if it is possible to get a list of objects that are currently locked by users inside a design repository?
I am looking for something that is equivalant to what v$locked_object is for Oracle objects. I've tried looking at the tables/views/procedures defined in the Control Center but I haven't been able to figure out a way to do it.
I am writing some scripts to automate the export/import of MDLs between repositories. I'd like to be proactive about checking locks in the repository before attempting to import the MDL.
Thanks.HI,
it seems that OWB uses DBMS_LOCK package for locking objects, so you can extract OWB internal lock names from SYS.DBMS_LOCK_ALLOCATED table (name OWB locks begin with 'OWB'). Locked object id (from all_iv_all_objects) specified at the end of lock name in reverse order.
But I don't now how to get type of locking (opening object also creates a lock).
Oleg -
Let me know creation of lock object
let me know creation of lock object
Hi
<b>Lock Objects</b>
Lock object concept
Lock modes
Creating a lock object (example)
Lock object sample code
SAP data dictionary provides you with a locking mechanism to synchronize simultaneous data access by different users.
Lock objects are created in SE11.
Customer lock objects must begin with EY or EZ .
Three possible lock modes exist for lock objects.
<b>Lock Mode</b>
Lock mode E: This sets a lock for changing data for single user. This lock can be accumulated.
Lock mode X: This mode is used like mode E for changing data. The only technical difference from mode E is that the respective lock does not allow accumulation.
Lock mode S: This mode ensures that data displayed in your program cannot be changed by other users during the entire display time. Here you do not want to change the data yourself (allows read only access for data).
<b>Creating Lock object</b>
SE11
1)Enter lock object name beginning with EY or EZ
and hit create.
2)Enter table names containing data records that should be locked and the lock mode.
Enter short text /tbale/lockmode.
3) The primary keys of the specified tables are automatically selected as lock parameters.
It automatically selects the primary key for the selected table.
To set a lock in the application program
call a function module ENQUEUE_<LOCK_OBJECT>.
For our example, it would be ENQUEUE_EZMARA.
To release the lock in the application program
call a function module DEQUEUE_<LOCK_OBJECT>.
For our example, it would be DEQUEUE_EZMARA.
Refer the code executed by user (say abap1) for
matnr = 000000000000000012.
Lock Objects are used to synchronize access to the same data by more than one user. Function modules that can be used in application programs are generated from the definition of a lock object in the ABAP Dictionary.
The R/3 System synchronizes simultaneous access of several users to the same data records with a lock mechanism. When interactive transactions are programmed, locks are set and released by calling function modules .These function modules are automatically generated from the definition of lock objects in the ABAP Dictionary.
Structure of a Lock Object
The tables in which data records should be locked with a lock request are defined in a lock object together with their key fields.
When tables are selected, one table (the primary table) is first selected. Further tables (secondary tables) can also be added using foreign key relationships.
Lock Arguments
The lock argument of a table in the lock object consists of the key fields of the table.
The lock argument fields of a lock object are used as input parameters in the function modules for setting and removing locks generated from the lock object definition. When these function modules are called, the table rows to be locked or
unlocked are specified by defining certain values in these fields.These values can also be generic. The lock argument fields therefore define which subset of the table rows should be locked
Data Dictionary/ Lock Objects
The simplest case of a lock object consists of exactly one table and the lock argument of the table is the primary key of this table. Several tables can also be included in a lock object. A lock request therefore can lock an entire logical
object, and not only a record of a table. Such a logical object can be for example a document comprising an entry in a header table and N entries in a positiontable.
Lock Mode
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:
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.
1) Select object type Lock object in the initial screen of the ABAP Dictionary, enter an object name and choose Create. The name of a lock object should begin with an E (Enqueue).The maintenance screen for lock objects is displayed.
2) Enter an explanatory short text in the field Short text. You can then use the short text to find the lock object at a later time, for example with the R/3 Repository Information System.
3) Enter the name of the primary table of the lock object. All other tables in the lock object must be linked with the primary table using foreign keys.
4) Select the lock mode of the primary table in the field below it The lock mode is used as the default value for the corresponding parameters of the function modules generated from the lock object.
5) Choose Add if you want to lock records in more than one
table with the lock object. A list of all the tables linked with the primary table using valid foreign keys is displayed. Select the appropriate table. The lock
mode of the primary table is copied as lock mode. You can change this setting as required, for example you can assign the lock mode separately for each table.
Similarly, you can add a table linked with the secondary table just added with foreign keys. To do this, place the cursor on the name of the secondary table and choose Add.
If no lock mode is assigned to a table, no lock is set for the
entries in this table when the generated function modules are
called. You should not assign a lock mode if a secondary table
was only used to define a path between the primary table and
another secondary table with foreign keys.
6) Save your entries.
A dialog box appears in which you have to assign the lock
object a development class.
7) You can define whether the function modules generated from
the lock object should be RFC-enabled on the Attributes tab
page. If you set the Allow RFC flag, the generated function
modules can be called from within another system with Remote
Function Call. If you permit Remote Function Calls for an
existing lock object, you must ensure that the generated
function modules are called from within an ABAP program with
parameters appropriate for the type. You should therefore check
all programs that use the associated function modules before
activating the lock object with the new option.
8) Choose Activate
<b>Reward if u sefull</b> -
What is the use for lock object and how to use the lock objects
Hi Guru's,
I am new to ABAP .Can you please clarify the that what is the use of lock object and how to use the loct object .what is use of the Deque & Enque function modules .hi ,
below are some minfo about lock objects :
Lock Objects
These types of objects are used for locking the access to database records in table. This mechanism is used to enforce data integrity that is two users cannot update the same data at the same time. With lock objects you can lock table-field or whole table.
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.
Creating Lock Objects
Lock object is an aggregated dictionary object and can be defined by using the following steps:
o From initial data dictionary screen, enter the name for the object, Click Lock object radiobutton and then click on Create. The system displays a dialog box for Maintain Lock Objects screen
o Enter short text as usual and the name for primary table.
-Save
-Select Tables option
From this screen you can:
Select secondary tables, 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.
1) 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.
2) 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.
3) 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.
Also, last but not the least, locking the object is logical (locking with any enqueue ) .so, you have to use the lock object while trying to access from second program .
reward if helpful ,
Regards,
Ranjita -
Query To Kill Locked Object's Session
Hi ,
Im trying to write script to getting sid & Serial# for frequently locked objects in my database.
i have tried with 3 ways as following, Pl Guide me for choosing better.
Query 1:
SELECT SID,SERIAL# FROM V$SESSION WHERE SID IN (SELECT SID FROM V$LOCKED_OBJECT WHERE OBJECT_ID IN ('34943','34957','34966')));
Query 2:
select
sess.sid,
sess.serial#
from
v$locked_object lo,
dba_objects ao,
v$session sess
where
ao.object_id = lo.object_id
and
lo.session_id = sess.sid
AND
AO.OBJECT_ID IN('34943','34957','34966');
Query 3:
select
sid,
serial#
from
select
sid,
serial#
from
v$session
) y,
select
b.session_id
from
select
object_id,
session_id,
locked_mode
from
v$locked_object
) b,
select
object_id,
object_name,
owner
from
dba_objects
where
object_name in ('PMA_DEFECT_DETAILS',
'PMA_DEFECT_HEADER',
'PMA_DEFECT_TRANS')
) c
Where
b.object_id = c.object_id
) x
Where
x.session_id = y.sid ;
Edited by: Abk on Jan 2, 2009 6:31 PM
Edited by: Abk on Jan 2, 2009 6:34 PMHi..
To know the lock you can use the query below, you will know the sid and find the serial# from v$session.
>
col sid for 9999
col id1 for 99999999
col id2 for 99999999
col lmode head "Lock Held" form a14
col request1 head "Lock Request" form a16
col type head "Lock Type" form a40
col ctime head "Time Held" form 99999
select sid,
DECODE(TYPE,
'BL','Buffer hash table',
'CF','Control File Transaction',
'CI','Cross Instance Call',
'CS','Control File Schema',
'CU','Bind Enqueue',
'DF','Data File',
'DL','Direct-loader index-creation',
'DM','Mount/startup db primary/secondary instance',
'DR','Distributed Recovery Process',
'DX','Distributed Transaction Entry',
'FI','SGA Open-File Information',
'FS','File Set',
'IN','Instance Number',
'IR','Instance Recovery Serialization',
'IS','Instance State',
'IV','Library Cache InValidation',
'JQ','Job Queue',
'KK','Redo Log "Kick"',
'LS','Log Start/Log Switch',
'MB','Master Buffer hash table',
'MM','Mount Definition',
'MR','Media Recovery',
'PF','Password File',
'PI','Parallel Slaves',
'PR','Process Startup',
'PS','Parallel Slaves Synchronization',
'RE','USE_ROW_ENQUEUE Enforcement',
'RT','Redo Thread',
'RW','Row Wait',
'SC','System Commit Number',
'SH','System Commit Number HWM',
'SM','SMON',
'SQ','Sequence Number',
'SR','Synchronized Replication',
'SS','Sort Segment',
'ST','Space Transaction',
'SV','Sequence Number Value',
'TA','Transaction Recovery',
'TD','DDL enqueue',
'TE','Extend-segment enqueue',
'TM','DML enqueue',
'TS','Temporary Segment',
'TT','Temporary Table',
'TX','Transaction',
'UL','User-defined Lock',
'UN','User Name',
'US','Undo Segment Serialization',
'WL','Being-written redo log instance',
'WS','Write-atomic-log-switch global enqueue',
'XA','Instance Attribute',
'XI','Instance Registration',
decode(substr(TYPE,1,1),
'L','Library Cache ('||substr(TYPE,2,1)||')',
'N','Library Cache Pin ('||substr(TYPE,2,1)||')',
'Q','Row Cache ('||substr(TYPE,2,1)||')',
'????')) TYPE,
id1,id2,
decode(lmode,
0,'None(0)',
1,'Null(1)',
2,'Row Share(2)',
3,'Row Exclu(3)',
4,'Share(4)',
5,'Share Row Ex(5)',
6,'Exclusive(6)') lmode,
decode(request,
0,'None(0)',
1,'Null(1)',
2,'Row Share(2)',
3,'Row Exclu(3)',
4,'Share(4)',
5,'Share Row Ex(5)',
6,'Exclusive(6)') request1,
ctime, decode(BLOCK,
0, 'Not Blocking',
1, 'Blocking',
2, 'Global',block) status
from
v$lock
where sid>5
and type not in ('MR','RT')
order by decode(request,0,0,2),block,5
==================================================
To know the session:--
col username for a20
col program for a20
col osuser for a15
SELECT NVL(s.username, '(oracle)') AS username,
s.osuser,
s.sid,
s.serial#,
p.spid,
s.status,
s.module,
s.machine,
s.program,
TO_CHAR(s.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time
FROM v$session s,
v$process p
WHERE s.paddr = p.addr
ORDER BY s.username, s.osuser;
>
HTH
Anand -
Download the lock object's technical setting on loack machine
Dear Experts,
I want to download lock object's technical setting on loack machine.when i give on selection screen name of local objects and desire path.it save on given path.
Please give me example for it.
Thanks & regard,
jatenAlso, when reviewing the Plumtree_.NET_Web_Controls_InstallLog.log there were 5 nonfatal erros. These error's were:
Install File: E:\plumtree\ptwc\2.0\bin\assemblies\edk.dll Status: ERROR Additional Notes: ERROR - java.io.FileNotFoundException: E:\plumtree\ptwc\2.0\bin\assemblies\edk.dll (The process cannot access the file because it is being used by another process)
Install File: E:\plumtree\ptwc\2.0\bin\assemblies\jsregistry.dll Status: ERROR Additional Notes: ERROR - java.io.FileNotFoundException: E:\plumtree\ptwc\2.0\bin\assemblies\jsregistry.dll (The process cannot access the file because it is being used by another process)
Install File: E:\plumtree\ptwc\2.0\bin\assemblies\log4net.dll Status: ERROR Additional Notes: ERROR - java.io.FileNotFoundException: E:\plumtree\ptwc\2.0\bin\assemblies\log4net.dll (The process cannot access the file because it is being used by another process)
Install File: E:\plumtree\ptwc\2.0\bin\assemblies\openfoundation.dll Status: ERROR Additional Notes: ERROR - java.io.FileNotFoundException: E:\plumtree\ptwc\2.0\bin\assemblies\openfoundation.dll (The process cannot access the file because it is being used by another process)
Install File: E:\plumtree\ptwc\2.0\bin\assemblies\Plumtree.WCFilter.dll Status: ERROR Additional Notes: ERROR - java.io.FileNotFoundException: E:\plumtree\ptwc\2.0\bin\assemblies\Plumtree.WCFilter.dll (The process cannot access the file because it is being used by another process)
When installing the Web Control's do you need to stop any services? I didn't see anything in the install notes about doing this? -
I've a TCode to modify a report. That TCode picks a doc no. from a table & opens up an editable ALV based on that doc. no .That doc. no. is the only primary key.
I want that if someone is already opened that report, & if someoen else is trying to open that report, it shouldn't open & should show that -"its locked by User XXX". I've made a lock object for that table. Please advise what to do next. How to populate the User name who has locked the report.used ENQUEUE function and DEQUEUE function
Function Modules for Lock Requests
Activating a lock object in the ABAP Dictionary automatically creates function modules for setting (ENQUEUE_<lock object name>) and releasing (DEQUEUE_<lock object name>) locks.
The generated function modules are automatically assigned to function groups. You should not change these function modules and their assignment to function groups since the function modules are generated again each time the lock object is activated.
Never transport the function groups, which contain the automatically generated function modules. The generated function modules of a lock object could reside in a different function group in the target system. Always transport the lock objects. When a lock object is activated in the target system, the function modules are generated again and correctly assigned to function groups.
Parameters of the Function Modules
Field Names of the Lock Object
The keys to be locked must be passed here.
A further parameter X_<field> that defines the lock behavior when the initial value is passed exists for every lock field <field>. If the initial value is assigned to <field> and X_<field>, then a generic lock is initialized with respect to <field>. If <field> is assigned the initial value and X_<field> is defined as X, the lock is set with exactly the initial value of <field>.
Parameters for Passing Locks to the Update Program
A lock is generally removed at the end of the transaction or when the corresponding DEQUEUE function module is called. However, this is not the case if the transaction has called update routines. In this case, a parameter must check that the lock has been removed.
Parameter _SCOPE controls how the lock or lock release is passed to the update program (see The Owner Concept for Locks). You have the following options:
キ _SCOPE = 1: Locks or lock releases are not passed to the update program. The lock is removed when the transaction is ended.
キ _SCOPE = 2: The lock or lock release is passed to the update program. The update program is responsible for removing the lock. The interactive program with which the lock was requested no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
キ _SCOPE = 3: The lock or lock release is also passed to the update program. The lock must be removed in both the interactive program and in the update program. This is the standard setting for the DEQUEUE function module.
Parameters for Lock Mode
A parameter MODE_<TAB> exists for each base table TAB of the lock object. The lock mode for this base table can be set dynamically with this parameter. The values allowed for this parameter are S (read lock), E (write lock), X (extended write lock), and O (optimistic lock).
The lock mode specified when the lock object for the table is created is the default value for this parameter. This default value can, however, be overridden as required when the function module is called.
If a lock set with a lock mode is to be removed by calling the DEQUEUE function module, this call must have the same value for the parameter MODE_<TAB>.
Controlling Lock Transmission
Parameter _COLLECT controls whether the lock request or lock release should be performed directly or whether it should first be written to the local lock container. This parameter can have the following values:
キ Initial Value: The lock request or lock release is sent directly to the lock server.
キ X: The lock request or lock release is placed in the local lock container. The lock requests and lock releases collected in this lock container can then be sent to the lock server at a later time as a group by calling the function module FLUSH_ENQUEUE.
Whenever you have lock mode X (extended write lock), locks should not be written to the local lock container if very many locks refer to the same lock table. In this case, there will be a considerable loss in performance in comparison with direct transmission of locks.
Behavior for Lock Conflicts (ENQUEUE only)
The ENQUEUE function module also has the parameter _WAIT. This parameter determines the lock behavior when there is a lock conflict.
You have the following options:
キ Initial Value: If a lock attempt fails because there is a competing lock, the exception FOREIGN_LOCK is triggered.
キ X: If a lock attempt fails because there is a competing lock, the lock attempt is repeated after waiting for a certain time. The exception FOREIGN_LOCK is triggered only if a certain time limit has elapsed since the first lock attempt. The waiting time and the time limit are defined by profile parameters.
Controlling Deletion of the Lock Entry (DEQUEUE only)
The DEQUEUE function module also has the parameter _SYNCHRON.
If X is passed, the DEQUEUE function waits until the entry has been removed from the lock table. Otherwise it is deleted asynchronously, that is, if the lock table of the system is read directly after the lock is removed, the entry in the lock table may still exist.
Exceptions of the ENQUEUE Function Module
キ FOREIGN_LOCK: A competing lock already exists. You can find out the name of the user holding the lock by looking at system variable SY-MSGV1.
キ SYSTEM_FAILURE: This exception is triggered when the lock server reports that a problem occurred while setting the lock. In this case, the lock could not be set.
If the exceptions are not processed by the calling program itself, appropriate messages are issued for all exceptions.
Reference Fields for RFC-Enabled Lock Objects
The type of an RFC-enabled function module must be completely defined. The parameters of the generated function module therefore have the following reference fields for RFC-enabled lock objects:
Parameters
Reference fields
X_<field name>
DDENQ_LIKE-XPARFLAG
_WAIT
DDENQ_LIKE-WAITFLAG
_SCOPE
DDENQ_LIKE-SCOPE
_SYNCHRON
DDENQ_LIKE-SYNCHRON
See also:
Example for Lock Objects
http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eebf446011d189700000e8322d00/content.htm -
Lock object is not working automatically
Hi experts,
i have a problem , A table is updated by a program which is used by multiple user . I have used lock function module 'ENQUEUE_E_TABLE ' and 'DEQUEUE_E_TABLE' for that . when updation section occurs first user which come first go through it and for rest users amessage cones 'table is locked by XYZ user' . When first completes the updation resr users is not updating automatically they stand at that position where message comes. How to solve this issue?
Avadhesh ChandraHi,
We can lock the table before updating the entries. Two types of locks are there.
1. To lock the entire table. Here when the table is locked by one program, another program will not be able to modify it.
2. To lock the particular record only. Here when the record is locked by one program, the other program can modify records other than the one locked.
For option 1
Use the FM ENQUEUE_E_TABLEE to lock the table and FM DEQUEUE_E_TABLEE to unlock table.
For option 2
Go to SE11. There enter the name of your lock object and create it. Next screen you have to mention which field you want to lock.
For more info. on LOCK OBJECTS go to
http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
If you want to lock the entire table, then use the FM said in option 1 in DO-ENDDO loop.
Run the loop till it gets successful (sy-subrc = 0)
DO.
*Call the FM.
IF sy-subrc = 0.
EXIT.
ENDIF.
ENDDO.
If you want to just try some number of times rather than keep on looping then can use for eg: DO 100 TIMES. -
Ora-04021 timeout occurred while waiting to lock object
Hai All
When adding a column into a table then an error comes error
Error Message:
ORA-04021: timeout occurred while waiting to lock object .....
How it happens ...what is the solution....please help
Shiju..Hi
Identify the session that is using this object, kill it and then perform the ALTER table... or wait until the session that is accessing this table release it.
Rgds
Adnan -
JDAPI Error: ORA-04020: deadlock detected while trying to lock object
I have written a JDAPI program to perform read-only impact analysis and report any problems.
The following error is occurring:
"A deadlock among DDL and parse locks is detected.
This deadlock is usually due to user errors in the design of an application or from issuing a set of concurrent statements which can cause a deadlock.
ORA-04020: deadlock detected while trying to lock object /NSPC6/CHECK_FOR_FORM_CHANGE"
The error refers to a procedure in a PL/SQL library.
In one case the error occurred after my final "end of processing" message, which is followed only by a call to "Jdapi.shutdown()".
Any ideas?
Thanks,
Neville Sweet.I have written a JDAPI program to perform read-only impact analysis and report any problems.
The following error is occurring:
"A deadlock among DDL and parse locks is detected.
This deadlock is usually due to user errors in the design of an application or from issuing a set of concurrent statements which can cause a deadlock.
ORA-04020: deadlock detected while trying to lock object /NSPC6/CHECK_FOR_FORM_CHANGE"
The error refers to a procedure in a PL/SQL library.
In one case the error occurred after my final "end of processing" message, which is followed only by a call to "Jdapi.shutdown()".
Any ideas?
Thanks,
Neville Sweet. -
Unable to delete Transport Request which contain locked objects
Hi all,
I need to delete some unusable transport requests but as they contain locked objects, it's not possible to delete them. Release operation is just allowed. After releasing these transport requests, I can not find them any more in queue. Please help to find these transport requests which are released and also provide a solution to delete instead of releasing them.
Thanks in advance,
Sanaz.Hi,
Thank you for the reply.
1. What do you mean by transport request , Shipment Request, Shipment Order or Tour.
A. I mean requests which can be transported between SAP Systems using TMS (Transport Management System).
2. What are the objects which has been locked and due to that you are facing this problem.
A. There are diffrent object types. For examle some customizing have booen done or SAP Note correction has been implemented, ... Therefore some objects have been locked due to these operations
3. Let's say if it's an freight Unit, then Pls confirm that System dump / error is not the cause for this.
A. I have no idea about "Freight Unit".
Thanks,
Sanaz.
Maybe you are looking for
-
I can't play songza even in legacy mode.
I had been using my computer without having made any updates to windows. When I finally realized my automatic updates weren't working I had about 300 critical updates. Several things weren't working, but Firefox and the Internet at the time weren't a
-
HOW DO I GO BACK TO TIGER ?
HI, I WISH TO GO BACK TO TIGER SINCE LEOPARD FEELS MORE LIKE A LEPER . I HAVE A IMAC INTEL CORE 2 . SPENT 129 $ FOR THAT BIG CAT BUT LOTS OF PROBLEMS SINCE INSTALL. DO I JUST PUT THE TIGER CD IN AND LEOPARD WILL RUN AWAY? PS. is that ok a
-
Editing Multiple Sections in M$ Word
OK so we have a crazy question about Microsoft Word Sections. We have a document that has information in the Footers of each page of this document. The document is several pages and the footers are sectioned out. A few of the pages are in one secti
-
Red X-boxes instead of pictures
Just downlded Flash and Red X-boxes appear where Flash pictures should be. I am coming back from total crashing, trying to use Farm Town game among general uses. At one point I did, in the crash box citing Flash 10c.ocx as problem, clicked "disable"
-
Time is not correct in CME even though it is right on the router it runs from
Hi all, We have a 2911 that is running CME on top of. The router time is correct but within the CME GUI it is one hour fast. I checked all the setting with timezone and others and it seems to be correct. In the GUI i tried to change the time and it w