Modifying locked object of a synchronization block

Hi everyone,
Does someone know what happens if an object used as lock in a synchronization block, is modified into the same block?
Look to the belowe example to clarify my question:
Object out is modified into the synchronization block: other threads that try to executed another synchonization block (with out as lock object) become able to execute it because now the reference is changed?
Thank you very much in advance.
Diego
synchronized (out) {
          try {               
               out = new PrintStream (new FileOutputStream (file));
               out.println ();
          } catch (FileNotFoundException e) {
.................

DiegoCarzaniga wrote:
Thank you very much Kajbj.
This means that JAVA synchronization uses object references to implement locks... is it correct?No. A monitor lock is associated with an instance and not with the reference to an instance.
E.g.
Object lock = new Object();
Object sameLock = lock;Here lock and sameLock are referencing the same object and that object only has one monitor so you can either synchronize on lock or sameLock (but I would advise against it since it might cause confusion)
Kaj

Similar Messages

  • Modify Application: Error Message:: Object Variable or With Block variable

    Hi Experts,
    We just installed 5.1 on our server and once the application is installed.
    When I try to modify the aplication I get this error at the end
    This is step what the modify app does:
    Check environment information
    Drop Fact table index.
    Modify fact table.
    Update application information.
    Set Fact table index.
    Create stored procedures and comment table.
    Increase application version and make legal consolidation table.
    Make OLAP database and Journal/Audit reports. / Validate dimension formulas.
    Error Message:: Object Variable or With Block variable
    Any one has any any answer ? I will appreciate your help on this.
    Thanks

    Please check if Reporting Services is working properly.
    Just open IE and type http://nameofserver/reports
    If you receive any error then you have to fix that error verifying configuration of RS.
    If RS is working make sure you add the right information into Server Manager Server Option for RS and Report Server virtual directory.
    Also please check the tblappsetinfo to have all the fields completed (regarding servers).
    Regards
    Sorin Radulescu

  • Delete modifiable transport with locked objects (SE10)

    Dear Forum,
    I have a request from a developer who wishes to have a transport deleted from SE10. the transport is in status modifiable, but it has locked objects. So when i try to delete the transport the system warns me that "Request/task XXXK900962 cannot be deleted because it contains locked objects".
    What is the "SAP Best Practice" way to get rid of this transport? Please explain in detail.
    Any input will be greatly appreciated!
    Thanks in advance,
    Kind Regards,
    Soren

    Hello Eric,
    I am facing an issue after deleting a repair object in the task.
    I could not add this entry in the task as it is not allowing. The object type is as below
    R3TR MCIN S901 (Its a change to info structure from SPRO - IMG activity)
    Now when I want to change the object, it is giving error.
    When I want to add same obj in the repair task manually it is not allowing.
    Can you please give me any suggestion.
    I believe as you said, when I delete a locked object, the traces that the object has been changed are deleted and hence it is giving the error.
    Is there any way to manually restore the object?
    Can I add the object using TR_APPEND_TO_COMM_OBJS_KEYS?
    Regards,
    Pratyusha

  • Synchronization parameter in lock object

    what if we give initial value to this parameter ,the lock deleted asynchronously ,
    i am not getting the meaning of asynchronously

    hi,suruchi
    i m asking
    if lock 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.
    Consider a scenario if we delete the lock ansynchronously is the lock deleted,
    or some time later if some other user wants to use the same lock object they
    can lock it or not?or what are the disadvantage of deleting lock asynchronously?
    Thanks for response

  • 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 PM

    Hi..
    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

  • Synchronization block question

    Hi, JDevelopers!
    Please, help me:
    If I have synchronization(obj) {} inside my class, and one thread blocks obj using this code, so may another thread that don't using synchronization to have an access to obj while first thread take lock on it?

    thread blocks obj using this codeThe thread doesn't block obj. Things that block are other threads waiting for the thread to exit the synchronized block(==code block, noun). Java lock object from which the monitor is gotten is quite indifferent to the synchronization mechanism per se.

  • 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 Chandra

    Hi,
    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.

  • Error while deleting loc - Object variable or With block variable not set

    I could not delete some of the existing locations in the HyperionFDM and it results in the error Object variable or With block variable not set.
    I verified that the Server has the apps and subfolder which is needed for this application \\servername\data\app1\Inbox etc.
    Any pointers will be really useful. Thanks !
    - Ap

    Hi,
    There can be several reasons for it, for now I would suggest you:
    This error generally comes because:
    Cause
    The user that logs on workbench does not have write access to the Financial Data Quality Management application shared folder.
    Solution
    Log onto the machine where the Financial Data Quality Management application files are located. You can locate this path by performing the following:
    a) At the FDM Login page choose <Add Application> and login
    b) Highlight the FDM Application in question and click the "Modify" button
    c) The application path field displays the location of the application folder
    2. Go the shared folder, right click and go to Properties -> Sharing -> Permissions and add the user to the Share Permissions and grant "Change" at a minimum.
    Please check and let me know
    I would suggest you to post FDM related posts in Financial Data Management
    J

  • Error: 1012704 Dynamic Calc processor cannot lock more than [25] ESM blocks

    Dear All,
    I get the Following Error in the Essbase console when I try to Execute any CalcScript.
    Error: 1012704 Dynamic Calc processor cannot lock more than [25] ESM blocks during the calculation, please increase CalcLockBlock setting and then retry(a small data cache setting could also cause this problem, please check the data cache size setting)_+
    Please find the detailed output of the Statics of my Planning Applications Database and outline.
    please help guys........
    GetDbStats:
    -------Statistics of AWRGPLAN:Plan1 -------
    Dimension Name Type Declared Size Actual Size
    ===================================================================
    HSP_Rates SPARSE 11 11
    Account DENSE 602 420
    Period DENSE 19 19
    Year SPARSE 31 31
    Scenario SPARSE 6 6
    Version SPARSE 4 4
    Currency SPARSE 10 10
    Entity SPARSE 28 18
    Departments SPARSE 165 119
    ICP SPARSE 80 74
    LoB SPARSE 396 344
    Locations SPARSE 57 35
    View SPARSE 5 5
    Number of dimensions : 13
    Declared Block Size : 11438
    Actual Block Size : 7980
    Declared Maximum Blocks : 3.41379650304E+015
    Actual Maximum Blocks : 1.87262635317E+015
    Number of Non Missing Leaf Blocks : 10664
    Number of Non Missing Non Leaf Blocks : 2326
    Number of Total Blocks : 12990
    Index Type : B+ TREE
    Average Block Density : 0.01503759
    Average Sparse Density : 6.936782E-010
    Block Compression Ratio : 0.001449493
    Average Clustering Ratio : 0.3333527
    Average Fragmentation Quotient : 19.3336
    Free Space Recovery is Needed : No
    Estimated Bytes of Recoverable Free Space : 0
    GetDbInfo:
    ----- Database Information -----
    Name : Plan1
    Application Name : AWRGPLAN
    Database Type : NORMAL
    Status : Loaded
    Elapsed Db Time : 00:00:05:00
    Users Connected : 2
    Blocks Locked : 0
    Dimensions : 13
    Data Status : Data has been modified
    since last calculation.
    Data File Cache Size Setting : 0
    Current Data File Cache Size : 0
    Data Cache Size Setting : 3128160
    Current Data Cache Size : 3128160
    Index Cache Size Setting : 1048576
    Current Index Cache Size : 1048576
    Index Page Size Setting : 8192
    Current Index Page Size : 8192
    Cache Memory Locking : Disabled
    Database State : Read-write
    Data Compression on Disk : Yes
    Data Compression Type : BitMap Compression
    Retrieval Buffer Size (in K) : 10
    Retrieval Sort Buffer Size (in K) : 10
    Isolation Level : Uncommitted Access
    Pre Image Access : No
    Time Out : Never
    Number of blocks modified before internal commit : 3000
    Number of rows to data load before internal commit : 0
    Number of disk volume definitions : 0
    Currency Info
    Currency Country Dimension Member : Entity
    Currency Time Dimension Member : Period
    Currency Category Dimension Member : Account
    Currency Type Dimension Member :
    Currency Partition Member :
    Request Info
    Request Type : Data Load
    User Name : admin@Native Directory
    Start Time : Mon Aug 15 18:35:51 2011
    End Time : Mon Aug 15 18:35:51 2011
    Request Type : Customized Calculation
    User Name : 6236@Native Directory
    Start Time : Tue Aug 16 09:44:10 2011
    End Time : Tue Aug 16 09:44:12 2011
    Request Type : Outline Update
    User Name : admin@Native Directory
    Start Time : Tue Aug 16 10:50:02 2011
    End Time : Tue Aug 16 10:50:02 2011
    ListFiles:
    File Type
    Valid Choices: 1) Index 2) Data 3) Index|Data
    >>Currently>> 3) Index|Data
    Application Name: AWRGPLAN
    Database Name: Plan1
    ----- Index File Information -----
    Index File Count: 1
    File 1:
    File Name: C:\Oracle\Middleware\user_projects\epmsystem1\EssbaseServer\essbaseserver1\APP\AWRGPLAN\Plan1\ess00001.ind
    File Type: INDEX
    File Number: 1 of 1
    File Size: 8,024 KB (8,216,576 bytes)
    File Opened: Y
    Index File Size Total: 8,024 KB (8,216,576 bytes)
    ----- Data File Information -----
    Data File Count: 1
    File 1:
    File Name: C:\Oracle\Middleware\user_projects\epmsystem1\EssbaseServer\essbaseserver1\APP\AWRGPLAN\Plan1\ess00001.pag
    File Type: DATA
    File Number: 1 of 1
    File Size: 1,397 KB (1,430,086 bytes)
    File Opened: Y
    Data File Size Total: 1,397 KB (1,430,086 bytes)
    File Size Grand Total: 9,421 KB (9,646,662 bytes)
    GetAppInfo:
    -------Application Info-------
    Name : AWRGPLAN
    Server Name : GITSHYPT01:1423
    App type : Non-unicode mode
    Application Locale : English_UnitedStates.Latin1@Binary
    Status : Loaded
    Elapsed App Time : 00:00:05:24
    Users Connected : 2
    Data Storage Type : Multidimensional Data Storage
    Number of DBs : 3
    List of Databases
    Database (0) : Plan1
    Database (1) : Plan2
    Database (2) : Plan3

    ESM Block Issue
    Cheers..!!

  • Patch 9239090 - ORA-04021: timeout occurred while waiting to lock object

    Hello Guys,
    I need help urgently to comlete an upgrade of ebs 12.1.1 to 12.1.3.
    We are upgrading ebs 11i to 12i going live this weekend. We have encountered "ORA-04021: timeout occurred while waiting to lock object" on patch 9239090 with two Workers:
    In adctrl:
    1 Run AutoPatch R120 AFUTLGRS.pls FAILED
    2 Run AutoPatch R120 AFUTLOGS.pls FAILED
    sqlplus -s APPS/***** @/u02/applfinp/apps/apps_st/appl/admin/OFPROD/out/p001invok.sql
    Connected.
    create or replace package wf_bes_cleanup AUTHID CURRENT_USER as
    ERROR at line 1:
    ORA-04021: timeout occurred while waiting to lock object
    I have done everything everything imaginable but cannot get pass these 2 failed workers.
    1) I have checked are there are no locks blocking on any objects:
    select s1.username || '@' || s1.machine
    || ' ( SID=' || s1.sid || ' ) is blocking '
    || s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
    from v$lock l1, v$session s1, v$lock l2, v$session s2
    where s1.sid=l1.sid and s2.sid=l2.sid
    and l1.BLOCK=1 and l2.request > 0
    and l1.id1 = l2.id1
    and l2.id2 = l2.id2 ;
    2) I also checked and there is space in the database.
    3) From adctrl, I have tried restarting the jobs one by one but the worker 1 hangs at and eventually fails on several (12) attempts.
    4) The solution on Doc ID 1291064.1 is not the problem:
    SQL> select SUPPLEMENTAL_LOG_DATA_MIN, SUPPLEMENTAL_LOG_DATA_PK, SUPPLEMENTAL_LOG_DATA_UI, FORCE_LOGGING
    from v$database;
    SUPPLEME SUP SUP FOR
    NO NO NO NO
    5) Manual execution still gave ORA-04021:
    sqlplus -s APPS/apps @/u02/applfinp/apps/apps_st/appl/admin/OFPROD/out/p001invok.sql
    sqlplus -s APPS/apps @/u02/applfinp/apps/apps_st/appl/admin/OFPROD/out/p002invok.sql
    6) The alert log has no related errors
    7) I Finally, after over 6 hours of waiting, I could only get the patch to continue after by using adctrl option 8 to skip these two workers.
    After proceeding, I have yet hit two more errors and now stuck:
    I have hit another error with the same patch:
    create or replace package body FND_LOG as
    /* $Header: AFUTLOGB.pls 120 ...
    AD Worker error:
    ORA-04021: timeout occurred while waiting to lock object
    Unable to process file in PACKAGE mode.
    Not converting file for Invoker's Rights because it appears to be a package body creation script (based on the filename).
    File is: /u02/applfinp/apps/apps_st/appl/fnd/12.0.0/patch/115/sql/AFUTLOGB.pls
    AD Worker warning:
    Product Data File
       /u02/applfinp/apps/apps_st/appl/admin/xniprod.txt
       does not exist for product "xni".
      This product is registered in the database but the above file does not exist in APPL_TOP.  The product will be ignored without error
    AD Worker error:
    The following ORACLE error:
    ORA-04063: package body "APPS.FND_LOG" has errors
    ORA-06508: PL/SQL: could not find program unit being called: "APPS.FND_LOG"
    ORA-06512: at "APPS.FND_FUNCTION", line 834
    ORA-06512: at "APPS.FND_MENU_ENTRIES_C_DELTRG", line 4
    ORA-04088: error during execution of trigger 'APPS.FND_MENU_ENTRIES_C_DELTRG'
    Can I stop and restart this patch 9239090?

    Hello,
    I later executed the failed jobs or scripts manually (successfully) for the patch to continue
    sqlplus -s APPS/apps @/u02/applfinp/apps/apps_st/appl/admin/OFPROD/out/p001invok.sql
    sqlplus -s APPS/apps @/u02/applfinp/apps/apps_st/appl/admin/OFPROD/out/p002invok.sql
    The patch ended with the following :
    The following Oracle Reports objects did not generate successfully:
    ap reports/US APXARATE.rdf
    ar reports/US ARXCTA.rdf
    fa reports/US FASRSVED.rdf
    ont reports/US OEXOEORD.rdf
    pa reports/US PAXACMPT.rdf
    pa reports/US PAXALRUN.rdf
    pa reports/US PAXACRPT.rdf
    pa reports/US PAXCPGAL.rdf
    pa reports/US PAXPCRFD.rdf
    The patch execution ended but the patch number is not record in apps.ad_bugs table:
    select TO_CHAR(CREATION_DATE,'dd-Mon-yyyy, hh24:mm:ss'), BUG_NUMBER from apps.ad_bugs where bug_number in ('9239090');
    no rows selected
    JFI
    Patches located in ad_applied_patches to which there is no a corresponding record in ad_bugs:
    SQL> SELECT a.patch_name, TO_CHAR(max(a.last_update_date),'dd-Mon-yyyy, hh24:mm:ss')
    2 FROM applsys.ad_applied_patches a
    3 WHERE NOT EXISTS (SELECT '1'
    4 FROM ad_bugs b
    5 WHERE b.bug_number = a.patch_name)
    6 group by a.patch_name;
    PATCH_NAME TO_CHAR(MAX(A.LAST_UP
    9239090 26-Oct-2013, 00:10:27
    AutoConfig 25-Oct-2013, 17:10:51
    merger9179588 25-Oct-2013, 11:10:30
    merger_post_5903765 27-Apr-2013, 23:04:45
    mergeu6678700 25-Oct-2013, 16:10:09
    What could have happened that this was not recorded in ad_bugs?
    How to I get this recorded in the ad_bugs table?
    Thanks
    Mathias

  • About lock object

    I have one TABLE with TABLE MAINTENANCE GENERATOR 
    and it has also LOCK OBJECT.
    Now I have adjusted the table by making some normal fields as primary keys
    and regenerated Table  maintenance generator ,
    It seems to me lock object also adjusted( I am able to see the newly converted primary key fields in lock object( in se11 ) ).
    Does the lock object automatically adjusts ????
    If lock object adjusts automatically --> what about the function modules ENQUEUE_ztable DEQUEUE_ztable ? these function modules also gets adjusted ?
    do I need to check the associated lock object impact ?
    How can I check ?

    Hi,
    No need to delete the Lock object. Just <b>remove</b> the Table which you modified from Lock object & <b>add again</b>. You can add the lock Parameters manually. It will be drived automatically from Table key fields.
    You no need to delete the lock object.
    Raja T
    Message was edited by:
            Raja T

  • Lock object

    Hi,
    In a program to update the database table I need to lock the table Is this correct to use enqueue functional module before the modify & commit statement
    and dequeue functional module after
    modify & commit statement.

    Hi,
    We can use the function modules ENQUEUE_E_TABLE for locking tables and the function module DEQUEUE_E_TABLE for unlocking tables. With this method, we don't need to lock objects in order to lock the tables. In other words, any table can be locked/unlocked using these function modules.
    report zsubhas_enqueue.
    * testing the locking of tables...
    data:
    varkey like rstable-varkey.
    varkey = sy-mandt.
    * locking the tables............................
    call function 'ENQUEUE_E_TABLE'
    exporting
    * MODE_RSTABLE = 'E'
    tabname = 'MARA'
    varkey = varkey
    * X_TABNAME = ' '
    * X_VARKEY = ' '
    * _SCOPE = '2'
    * _WAIT = ' '
    * _COLLECT = 'X'
    exceptions
    foreign_lock = 1
    system_failure = 2
    others = 3
    case sy-subrc.
    when 1.
    message i184(bctrain) with 'Foreignlock'.
    when 2.
    message i184(bctrain) with 'system failure'.
    when 0.
    message i184(bctrain) with 'success'.
    when others.
    message i184(bctrain) with 'others'.
    endcase.
    * unlocking the table...............
    call function 'DEQUEUE_E_TABLE'
    exporting
    * MODE_RSTABLE = 'E'
    tabname = 'MARA'
    varkey = varkey
    * X_TABNAME = ' '
    * X_VARKEY = ' '
    * _SCOPE = '3'
    * _SYNCHRON = ' '
    * _COLLECT
    Regards
    Sudheer

  • Lock object issue

    Dear Experts,
    We are using the fn. Module "SD_SALES_DOCUMENT_ENQUEUE", to process a sales order with multi line item and to unlock the table, we are using "DEQUEUE_ALL", but for some reason, in the sales order processing when the system comes to next line item, the lock object is throwing an error, I'm not sure if this is due to the lock not being released on the order.
    1st item success
    2nd item failure
    3rd item success
    4th item failureu2026.not always the same pattern, but usually.
    Please suggest .
    Thanks
    -Amit

    Hi Zekeriya,
    I have tried with the query you mentioned but didnt get any output.STILL THE PROBLEM PERSISTS...
    SQL> select s1.username || '@' || s1.machine
    || ' ( SID=' || s1.sid || ' ) is blocking '
    || s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
    from v$lock l1, v$session s1, v$lock l2, v$session s2
    where s1.sid=l1.sid and s2.sid=l2.sid
    and l1.BLOCK=1 and l2.request > 0
    and l1.id1 = l2.id1
    and l2.id2 = l2.id2 ; 2 3 4 5 6 7 8
    no rows selected

  • Lock Object (Not locking the table)

    Hi Guys
    I have a custom table ZDRAD same like standard table DRAD with an additional 'DATE' field . ZDRAD's Key fields are same like DRAD . I have created a lock object 'EZDRAD' where I put name = 'ZDRAD' (Custom table) and mode = 'EXCLUSIVE CUMULATIVE' . Now I want to lock the table(Whole table) before modifying/Inserting/deleting the records in se38. Please check the code below and suggest me if I am passing wrong values to the lock object Function module.
    Code
    TABLES : ZDRAD.
    CALL FUNCTION 'ENQUEUE_EZDRAD'
    EXPORTING
       MODE_ZDRAD           = 'E'
       MANDT                = SY-MANDT
       DOKAR                = ' '
       DOKNR                = ' '
       DOKVR                = ' '
       DOKTL                = ' '
       DOKOB                = ' '
       OBZAE                = 0
       OBJKY                = ' '
       X_DOKAR              = ' '
       X_DOKNR              = ' '
       X_DOKVR              = ' '
       X_DOKTL              = ' '
       X_DOKOB              = ' '
       X_OBZAE              = ' '
       X_OBJKY              = ' '
       _SCOPE               = '2'
       _WAIT                = 'X'
       _COLLECT             = ' '
    EXCEPTIONS
       FOREIGN_LOCK         = 1
       SYSTEM_FAILURE       = 2
       OTHERS               = 3
    *IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    IF SY-SUBRC = 0.
    ZDRAD table is locked.
        P_L_LOCK_STAT = 'X'.
        EXIT.
      ELSE.
    ZDRAD table is not locked
        CLEAR P_L_LOCK_STAT .
      ENDIF.

    Hi Kanthimathi
    That is numeric field . Please suggest me how can i check the lock.

  • Lock object not working.

    Hi,
    I am trying to create a lock object.
    Having following doubts:
    1) In one program, ENQUEUE function for that lock object But DEQUEUE function is not called. So the record on which the ENQUEUE function is called will remain locked for ever or only till the program ends?
    2) 1 program ZXYZ has ENQUEUE function on one record...But it has not DEQUEUE function in it....... second program ZXYZ1 is trying to edit that record....what should happen??
    According to me, that second program should not be able to edit it until the table has given record to DEQUEUE function. Correct me if I am wrong.
    But in these programs, Second program is able to edit the record locked by the first program. This is true if Lock Mode of the Lock object is Read Lock/Write Lock /Exclusive, Not cumulative.
    Please let me know your valuable inputs.
    Regards,
    Pooja

    Hi ,
    Thanks for all your replies.
    Please find below both the programs. SY-SUBRC is zero in both the programs.
    Let me know if anything is wrong in the code. Commit work is not used anywhere in the program explicitly.
    *First Program: *
    REPORT  ztestxyz.
    TABLES: zcrossref.
    DATA: wa_zcrossref TYPE zcrossref.
    wa_zcrossref-business_unit = 'TOPS'.
    wa_zcrossref-conversion_type = 'KS'.
    wa_zcrossref-legacy_code = '0314'.
    wa_zcrossref-sap_code = '0314'.
    CALL FUNCTION 'ENQUEUE_EZTEST'
      EXPORTING
        mode_zcrossref    = 'E'
        client            = sy-mandt
        business_unit     = wa_zcrossref-business_unit
        conversion_type   = wa_zcrossref-conversion_type
        legacy_code       = wa_zcrossref-legacy_code
        x_business_unit   = ' '
        x_conversion_type = ' '
        x_legacy_code     = ' '
        _scope            = '2'
        _wait             = ' '
        _collect          = ' '
      EXCEPTIONS
        foreign_lock      = 1
        system_failure    = 2
        OTHERS            = 3.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
      WRITE: 'Sucessful.' .
      UPDATE zcrossref FROM wa_zcrossref.
      WAIT UP TO 20 SECONDS.
    ENDIF..
    Second program:
    REPORT  ztestxyz1.
    *DATA: wa_loan TYPE zloandeposit.
    *wa_loan-xblnr = 'FWD3939'.
    *wa_loan-doctyp = 'AB'.
    *MODIFY zloandeposit FROM wa_loan.
    Data: wa_zcrossref type zcrossref.
    wa_zcrossref-business_unit = 'TOPS'.
    wa_zcrossref-conversion_type = 'KS'.
    wa_zcrossref-legacy_code = '0314'.
    wa_zcrossref-sap_code = 'XYZ2'.
    UPDATE zcrossref FROM wa_zcrossref.
    IF sy-subrc = 0.
      WRITE: 'Succesful.!!'.
    ELSE.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Regards,
    Pooja

Maybe you are looking for

  • Problems e-mailing photos

    When I try and email photos from iphoto I get the following message  "The email server didn't recognize your username/password combination".  I have no problem sending e-mail directly from the e-mail program but I can't attach photos.  This seems to

  • What app do I need to burn imovies to dvd

    I have a new imac - no internal superdrive- I bought a stand alone. I need to burn imovies to dvd. Idvd no longer works with new imac, I purchased Toast - that does not work, I downloaded Free DVD creator - that does not work either. I have been foll

  • Internet Sharing wont work on airport

    I recently tried turning internet sharing on my my macbook and when i connect on my ipod touch i cant connect to the internet and on the computer it shows the ip address ant tells me that i cannot connect to the interent.

  • Missing transactions in SAP EWM

    Hi, We have recently procured a new system with the follwoing SAP components: 1.  SAP ECC 6.0 including Enhancement Package EhP6 2.  SAP EWM 7.0 Add-on component including Enhancement Package EhP2 Now, during the configuration we are not being able t

  • Auth Problem: restricting cost centre in ME21/ME21N

    Hi,   i need to restrict certain cost centres for some users in tcode ME21/ME21N .Currently there is no check in the programme.We have many plants in our system and many roles for different countries with this transaction.i need to activate this chec