Issue in locking Table

Hi All,
I need to update a  ZTABLE with UNIQUE serial number while creating shipment and Delivery.
I have used ENQUEUE_E_TABLE to lock the table before updating table in both the ZProgram which will update the serial numbers.
The problem is even though i locked the table , i am facing problem with creation of duplicate number serial numbers while shipment and delivery happens at the same time.We have tested this with multiuser environment.
Since both shipment and delivery updating in UPDATE TASK i coudnt use COMMIT WORK in the programs.
Please let me know if there are any tricks how to lock the table and also for using COMMIT WORK inside UPDATE TASK.
Give some example program for locking tables especialy used in update task.
Thanks and Regards,
kandakumar

Hi
Lock the table before updating it and check the locking with sy-subrc and if it is not locked then use do loop to lock the table.
See the dummy code ,hope it will help you.
Do n times.
*Lock the table
*Check sy-subrc if it is 0 exit the loop else
try again.
if locking is suceessfull.
set a flag.
endif.
Enddo.
If flag is not set give the message table is not locked.
else if it is locked then proceed with updation
Cheers
Neha shukla

Similar Messages

  • Issue: Lock table is out of available object entries

    Hi all,
    We have a method to add records into BDB, and after there are more than 10000 records, if we continue add records into BDB, such as add 400 records into BDB, then do other update/add operation to BDB, it will be failed.
    The error message is Lock table is out of available object entries.
    How to resolve it?
    Thanks.
    Jane.

    Frist the BDB stat as bellow:
    1786 Last allocated locker ID
    0x7fffffff Current maximum unused locker ID
    9 Number of lock modes
    2000 Maximum number of locks possible
    2000 Maximum number of lockers possible
    2000 Maximum number of lock objects possible
    52 Number of current locks
    1959 Maximum number of locks at any one time
    126 Number of current lockers
    136 Maximum number of lockers at any one time
    26 Number of current lock objects
    1930 Maximum number of lock objects at any one time
    21M Total number of locks requested (21397151)
    21M Total number of locks released (21397099)
    0 Total number of lock requests failing because DB_LOCK_NOWAIT was set
    0 Total number of locks not immediately available due to conflicts
    0 Number of deadlocks
    0 Lock timeout value
    0 Number of locks that have timed out
    0 Transaction timeout value
    0 Number of transactions that have timed out
    736KB The size of the lock region
    0 The number of region locks that required waiting (0%)
    Then I run the method to insert 29 records into BDB, the BDB isn't locked yet, and the stat:
    1794 Last allocated locker ID
    0x7fffffff Current maximum unused locker ID
    9 Number of lock modes
    2000 Maximum number of locks possible
    2000 Maximum number of lockers possible
    2000 Maximum number of lock objects possible
    52 Number of current locks
    1959 Maximum number of locks at any one time
    134 Number of current lockers
    136 Maximum number of lockers at any one time
    26 Number of current lock objects
    1930 Maximum number of lock objects at any one time
    22M Total number of locks requested (22734514)
    22M Total number of locks released (22734462)
    0 Total number of lock requests failing because DB_LOCK_NOWAIT was set
    0 Total number of locks not immediately available due to conflicts
    0 Number of deadlocks
    0 Lock timeout value
    0 Number of locks that have timed out
    0 Transaction timeout value
    0 Number of transactions that have timed out
    736KB The size of the lock region
    0 The number of region locks that required waiting (0%)
    Then I run the method again to insert records, the issue "Lock table is out of available locks" occur, and the BDB stat:
    1795 Last allocated locker ID
    0x7fffffff Current maximum unused locker ID
    9 Number of lock modes
    2000 Maximum number of locks possible
    2000 Maximum number of lockers possible
    2000 Maximum number of lock objects possible
    52 Number of current locks
    2000 Maximum number of locks at any one time
    135 Number of current lockers
    137 Maximum number of lockers at any one time
    27 Number of current lock objects
    1975 Maximum number of lock objects at any one time
    26M Total number of locks requested (26504607)
    26M Total number of locks released (26504553)
    0 Total number of lock requests failing because DB_LOCK_NOWAIT was set
    0 Total number of locks not immediately available due to conflicts
    0 Number of deadlocks
    0 Lock timeout value
    0 Number of locks that have timed out
    0 Transaction timeout value
    0 Number of transactions that have timed out
    736KB The size of the lock region
    0 The number of region locks that required waiting (0%)
    Why this issue occur and how to resolve this issue.
    Thanks very much.
    Jane

  • IDOC Receiver Adapter, getting Lock Table Overflow to CRM System

    Hello SDN!!!
    This scenario is for PI to process a file and send to CRM via IDOC. The IDOCu2019s are only being created and not processed until later.
    Problem: I am getting a Lock Table Overflow error in method IDOC_INBOUND_ASYNCHRONOUS via sm58 in PI which points to the CRM box.
    I have been searching many forums and every solution seems to indicate increasing the lock table, the problem with that solution is we are currently trying to create (not process yet) 80000 IDOCu2019s. This would allocate too much for the lock table.
    So my question is this, Shouldnu2019t the lock be released when the IDOC gets created or none the less when a packet of IDOCu2019s via content management (breaking up the file in 1000 increments) finish. The lock table in CRM keeps increasing until all rows from the file, sent via IDOC adapter in 80 messages with 1000 IDOCu2019s per messagein the table are complete (80 separate messages in sxmb_moni).
    Background:
    IDOC was imported, changed to include unbounded and reimported.
    Content Management breaks the file into 80 different segments, thus creating 80 distinct mappings with distinct MessageIdu2019s.
    80 IDOC packets are sent to CRM, via IDOC adapter and sm58.
    TCODE sm12 in CRM shows the table to keep growing and locks not released until full message is complete.
    Any help would be appreciated
    Cheers
    Devlin

    The only way to process the IDOCs in this case is by increasing the "enque/table_size" parameter in order to create the required IDOCs. You can increase the value for this parameter up to 102400 (beyond that can cause performance issues). Since you need to handle 80000, this shouldn't be an issue.
    Please refer to the notes below for more information about the lock queue overflow and management.
    [Note 552289 - FAQ: R/3 Lock management|https://websmp230.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=552289]
    [Note 13907 - System error in the block handler, overflow lock table|https://websmp230.sap-ag.de/sap(bD1wdCZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=13907]

  • MM42 change material, split valuation at batch level, M301, locking table

    Dear All,
    I'm working on ECC 6.0 retail and I have activated split valuation at batch level.  Now in MBEW for this specific material I have almost 14.400 entries.
    If I try to change some material data (MM42) I receive an error message M3021 A system error has occurred while locking and then Lock table overflow.
    I used SM12 to see the table (while MM42 is still running) and it seems that MBEW is the problem.
    What should I do?  For any material modification the system has to modify every entry in MBEW? Is there any possibility to skip this?
    Thank you.

    Hi,
    Symptom
    Key word: Enqueue
    FM: A system error has occurred in the block handler
    Message in the syslog: lock table overflowed
    Other terms
    M3021 MM02 F5 288 F5288 FBRA
    Reason and Prerequisites
    The lock table has overflowed.
    Cause 1: Dimensions of the lock table are too small
    Cause 2: The update lags far behind or has shut down completely, so that the lock entries of the update requests that are not yet updated cause the lock table to overflow.
    Cause 3: Poor design of the application programs. A lock is issued for each object in an application program, for example a collective run with many objects.
    Solution
    Determine the cause:
    SM12 -> Goto -> Diagnosis (old)
    SM12 -> Extras -> Diagnosis (new)
    checks the effectiveness of the lock management
    SM12 -> Goto -> Diagnosis in update (old)
    SM12 -> Extras -> Diagnosis in update (new)
    checks the effectiveness of the lock management in conjunction with updates
    SM12 -> OkCode TEST -> Error handling -> Statistics (old, only in the enqueue server)
    SM12 -> Extras -> Statistics (new)
    shows the statistics of the lock management, including the previous maximum fill levels (peak usage) of the partial tables in the lock table
    If the owner table overflows, cause 2 generally applies.
    In the alert monitor (RZ20), an overrunning of the (customizable) high-water marks is detected and displayed as an alert reason.
    The size of the lock table can be set with the profile parameter u201Cenque/table_size =u201C. specifies the size of the lock table in kilobytes. The setting must be made in the profile of the enqueue server ( u2026_DVEBM.. ). The change only takes effect after the restart of the enqueue server.
    The default size is 500 KB in the Rel 3.1x implementation of the enqueue table. The resulting sizes for the individual tables are:
    Owner table: approx 560.
    Name table: approx 560.
    Entry table: approx 2240.
    As of Rel 4.xx the new implementation of the lock table takes effect.
    It can also be activated as described in note 75144 for the 3.1I kernel. The default size is 2000 KB. The resulting sizes for the individual tables are:
    Owner table: approx 5400
    Name table: approx 5400
    Entry table: approx 5400
    Example: with the
    u201Cenque/table_size =32000u2033 profile parameter, the size of the enqueue table is set to 32000 KB. The tables can then have approx 40,000 entries.
    Note that the above sizes and numbers depend on various factors such as the kernel release, patch number, platform, address length (32/64-bit), and character width (Ascii/Unicode). Use the statistics display in SM12 to check the actual capacity of the lock table.
    If cause 2 applies, an enlargement of the lock table only delays the overflow of the lock table, but it cannot generally be avoided.
    In this case you need to eliminate the update shutdown or accelerate the throughput of the update program using more update processes. Using CCMS (operation modes, see training BC120) the category of work processes can be switched at runtime, for example an interactive work process can be converted temporarily into an update process, to temporarily increase the throughput of the update.
    For cause 3, you should consider a tuning of the task function. Instead of issuing a large number of individual locks, it may be better to use generic locks (wildcard) to block a complete subarea. This will also allow you to considerably improve the performance.

  • Error  " RFC Status :-  Lock table overflow "in event trace  ( SWEL )

    Hi experts ,
    I will not mention this post as URGENT but you guys can understand the importance as I am in PRD Support of my workflows .
    My Workflow is throughing error in SWEL  , as below   and after error its getting deactivated .
    The workflow is triigering based on the  BO : DRAW and event CREATED .
    Error :  RFC Status           Lock table overflow
    In feedback after error the message is : A system error has occurred in lock management .
    I have resolved the deactivation problem after error  , but   can any body please suggest me  what is the root cause of this error , so that i can try to avoid that error .
    Regards
    Prabhudutta
    Edited by: Prabhudutta Behera on Nov 20, 2008 5:58 AM

    This error I have not faced. i will suggest you to check SWU3 transaction Code and check everything is configured. Also check SM12 and SM58. Also I will ask you to contact the Basis Guys related to this issue. Also check WF-BATCH is having all the authorization required. Try to replicate this from the system where Workflow is working.
    Thanks
    Arghadip

  • Lock table overflow - Delta (fetch)

    Hi,
    I have an InfoCube which contains large amount of data. Before starting to extract data from this InfoCube, I want to set datamart status as fetched to start extractions with new coming requests.
    However, when I choose the processing mode of DTP as "9 No Data Transfer; Delta Status in Source: Fetched" and execute the DTP, it ends with an error: "Lock table overflow".
    Is there any way to solve this without increasing the lock table parameters (enque/table_size) ?
    Regards,
    Erdem

    You need to first resolve the issue with the "Lock table Overflow"....usign the below method in RZ10.
    Here you can solve the problem in two ways
    1) increase the size of the lock table via parameter
    enque/table_size
    2) or increase the enque work processes from 1 to 2 or 3
    via parameter rdisp/wp_no_enq
    Ask Basis team for their assistance on the same.
    Thanks
    Murali

  • Error locking table TBTCO

    Hi,
    We are having issue in locking "Error locking table TBTCO" at our SM12 statics Maximum Number of Lock Owners     3603
    Even on increasing the enque/table_size it not effecting the lock owner. Our environment having enq replication server.
    The profile parameter for enque/serverinst = $(SCSID) (00)
    enque replication server instance number is 10
    What could be the correction need to be done?
    Regards,
    RMav

    You have to check the reason for the error in the lock.
    Get the Work Process number that logged the error in SM21. Check the trace file of this work proces. At the same timestamp of the error in SM21 you do find the root cause in the work process trace.
    Usually this is caused by a overflow in the enqueue table, but not always. For this reason you have to check the work process trace the reasl root cause.
    To check if the enqueue is suffering a overflow you should go to SM12 -> Extras -> Statistics
    If in the statistics you do find that the "Maximum Fill Level" reached the maximum number of locks in these itens, for example:
    Maximum Number of Lock Owners 39481
    Maximum Fill level 458                               
    Current Fill Level -25
    Maximum Number of Lock Arguments 39481  <<<
    Maximum Fill level 39480                                 <<<
    Current Fill Level 15
    Maximum Number of Lock Entries 39481    <<<
    Maximum Fill level 39480                             <<<
    this means that the enqueue was really suffering under an overflow situation.
    Just for your information, the TBCTO is the table for the status of the jobs. So, every job need
    to write the status in this table and also lock this table firstly.
    Clébio

  • Lock table overflow in SAP

    We are tyring to execute a transaction and it is giving the error Lock table overflow, Though the  enque/table_size parameter is set to 96,000 KB which i guess good enough.
    Can you please suggest.
    Thanks,
    Chandu

    Hello Chandu,
    how many records this transaction is locking?
    SAP Note 746138: Analyzing lock table overflows, describes how to analyze this issue.
    Are you using Standalone enqueue? If that's the case check that the enqueue table size is defined in the ASCS instance.
    kind regards,
    Mercedes

  • Lock Table Overflow Error in SM58

    Hi Team,
    Error has observed on transactional RFC (SM58),it is happing  every monday during business hours .So we observed that same day db2 automatic reorg job is running same day and same time in SAp PI .Please confirm is this issue with SAPPI or target system ?
    Error Text: “Lock table overflow”
    This issue has fixed after reorg job finished automatically .is there any relation b/w lock table and reorg job ?
    I observed that this was due to DB2 reorg job causing the issue.Please correct me if am wrong ?
    Regards ,
    Ravindar.a

    Hi
    Please check the following link:
    http://help.sap.com/saphelp_nw04/helpdata/en/37/a2e3ba344411d3acb00000e83539c3/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/d3/43d2416d9c1c7be10000000a1550b0/frameset.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-basis/lock-table-overflow-506470
    Mutti

  • Lock table in share mode

    hi ...
    what is the benifit to lock the table explicitily using sql command
    "lock table <table_name> in share mode"
    is there any performance gain. ?
    code....
    ==================
    *Here, we lock the table in share mode
    EXEC SQL
    LOCK TABLE GLDM IN SHARE MODE
    END-EXEC.
    EXEC SQL
    LOCK TABLE GLDV IN SHARE MODE
    END-EXEC.
    EXEC SQL DECLARE D_ACCOUNT_CURSOR CURSOR FOR
    SELECT /*+ FIRST_ROWS */
    ===================================================

    As others have pointed out, this type of locking should be unnecessary. Unless there is documentation explaining why the locks are there, we can only guess the intention. Here are a couple of thoughts:
    a) The cursor select is used to create results that are copied from one table to another (e.g. the query is against gdlm and the results are used to update gdlv in a loop) - a lock on the table being updated might then be seen as necessary to ensure that no other process updates it in a conflicting fashion whilst the loop is running - thus avoiding problems of inconsistent results, or a locking/deadlocking issues.
    b) If the cursor loop takes a long time to run then (for read consistency purposes) the session has to keep generating clones of blocks that have changed since the query started. So the table locking may have been introduced as a way of reducing this cloning work by stopping any other changes. This could be seen as a performance enhancer - at a cost of blocking anyone else who wants to update the tables.
    c) For reasons similar to (b) it may have been introduced to reduce the risk of Oracle error ORA-01555 (Snapshot too old).
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • Locked table by an insert

    Hi,
    some times an insert locks all the concerned table this transaction is always from web.
    Any idea?
    regards.

    Here are some questions:
    How can the table be locked, preventing DML by other users?
    1) Is your application or users issuing SELECT FOR UPDATE commands
    2) Is your application or users issuing LOCK TABLE IN EXCLUSIVE MODE
    3) Is referential integrity being checked on foreign keys that do not have an index? If so, shared locks can be issued against the table limiting DML execution until the RI checks are complete.
    Are you sure there is a table lock?
    1) What are users waiting on when this problem occurs? Check v$session_wait for this. Also join v$session and v$lock on SID to see who has the lock(s) blocking the table.

  • Lock table overflow - BRF Plus - can it work with many entries in tables ?

    hi,
    when I'm trying to open expression table in BRFplus with 500 entries in web
    I get an error: Lock table overflow and I see more then 2000 entries in sm12 for fdt_ tables
    and the system cannot create any more locks (so other applications are not working)
    why is that ? can BRF plus work with more then 100 entries in table expressions at all ?
    can anyone tell from experience as this is a huge issue I believe
    thank you,
    Regards,
    Michal Krawczyk

    Hi Michal,
    You are running a NW 701 system. This was the first version of BRFplus and the DB schema was not good for high volumne.
    I have created some notes recommending to use decision table for up to 100 rows (of course other factors like # of columns are also important).
    In NW 702 the DB schema has been changed and decision tables with 10.000 rows are possible and performance better by a factor of 100 and more.
    In your specific case you may consider to increase the number of logs that are possible. But this is rather a workaround than a solution.
    BR,
    Carsten

  • Lock table is out of available object entries

    hi,
    i am using db4.6.21 version.
    i have created an table where other applications writes to this tables concurrently.
    this table opened in DB_THREAD and every application writing in DB_WRITE_CURSOR mode. and i am note using any Locking subsystems.only READ_COMMITTED and DB_WRITE_CURSOR are used by applications to access the table.
    while In PC it is working properly.
    But in At91SAM9260EK with kerenl 2.6.23.9 ,
    Berkeley DB error: Lock table is out of available object entries
    error comes...what would be the reason..???

    Hi Ratheesh,
    Please search through the forum; similar locking subsystem configuration issues have already been discussed.
    In short, you'll need to increase the number of lock objects:
    http://www.oracle.com/technology/documentation/berkeley-db/db/ref/lock/max.html
    I see you're using the DB_WRITECURSOR flag which is specific to CDS (Concurrent Data Store), so you should size the locking subsystem appropriately to CDS: the number of lock objects needed is two per open database (one for the database lock, and one for the cursor lock when the DB_CDB_ALLDB option is not specified). The locking subsystem configuration should be similar for all the processes accessing the environment, or not specified for the processes that just join the environment.
    If you still see this error message reported, provide some information on your OS/platform, information on how the processes access the environment and the locking statistics (db_stat -N -Co -h <env_dir>).
    Regards,
    Andrei

  • Lock tables when load data

    Are there any way to lock tables when i insert data with SQL*Loader? or oracle do it for me automatically??
    how can i do this?
    Thanks a lot for your help

    Are there any problem if in the middle of my load (and commits) an user update o query data ?The only problem that I see is that you may run short of undo space (rollback segment space) if your undo space is limited and the user is running a long SELECT query for example: but this problem would only trigger ORA-1555 for the SELECT query or (less likely since you have several COMMIT) ORA-16XX because load transaction would not find enough undo space.
    Data is not visible to other sessions, unless, the session which is loading data, commits it. That's the way Oracle handle the read committed isolation level for transaction.
    See http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96524/c21cnsis.htm#2689
    Or what happens if when i want to insert data someone has busy the table?You will get blocked if you try to insert data that has the same primary key as a row being inserted by a concurrent transaction.

  • System error: Unable to lock table/view V_T077K_M

    Hi,
    Not able to work on field selection (OMSG) i am getting an error "System error: Unable to lock table/view V_T077K_M" checked in SM 12 also, but dint get there anything.
    please cud you help me in this regard,

    contact your basis team,  there might be an overflow of the lock table because of mass changes from other users (even for other tables)

Maybe you are looking for

  • How do I move photos in iphoto for ipad from album to album ?

    how do i move photos in iPhoto for iPad from album to album ?

  • At what point is a user record created in the WWSEC_PERSON$ table?

    Hello - We are using OID for our SSO into the Oracle Portal. When we sync AD -> OID, when I query the Portal WWSEC_PERSON$ table and the new users are not present. I have to go into the Portal Administration page, query one of the users and set a def

  • YouTube Videos not working in Safari on iPad 2

    When I use YouTube in Safari on my iPad 2, I noticed that the official music videos are not working in YouTube. I get an error message which states "Video cannot be played on mobile." Below is a link to the all time most watched videos. Not music vid

  • ALL_WM_LOCKED_TABLES access issue

    Hi, This is an issue with accessing the Workspace Manager view ALL_WM_LOCKED_TABLES. Basically, while a process is running creating various Oracle users and establishing a version-enabled schema in each of them, another Oracle user may receive the er

  • Using iPod A/V Cable to connect to speakers...

    Can you use the iPod A/V cable to connect a MacBook to speakers or is the cable designed to be used only with the iPod? I've tried doing this twice with two different sets of speakers and there is sound coming through the speakers, but it sounds like