Question on lock

Hiii
I have an enhancement that have been implement at the end of a creation of an inbound deliveries.
My requirement is as follow
After the creation of the inbound deliveries after the commit of the delviery, I call a FM BAPI_BATCH_CREATE to create batch etc..
The issue i am having is that suppose i am creating 2 delivery
for the first delivery the FM fail BAPI_BATCH_CREATE and this is cause by an collision in enqueue EMMARCS.  I saw that in ST05
For the second delivery this work fine
I wanted to correct the error by
by checking before the calling of the FM BAPI_BATCH_CREATE if enqueue EMMARCS fail i dequeue it.  But i think there may be regressing since the program may be updating something in MARCS and i am throwing it out because of My dequeue?
Please advise

Hi,
   When there are situations where parallel updates are happening, i usually do a wait to allow significant time for the first process to complete.
Do 5 times.
  CALL <ENQUEUE>
  IF locked
    if cnt eq 5
      call <Dequeue>
      exit.
    else.
       cnt = cnt + 1.
       Continue.
    endif
  ELSE.
    EXIT.
  ENDIF.
ENDDO.
Hope this helps.
Regards,
San

Similar Messages

  • Questions on Locking-- URGENT

    Here are my questions on Locking.:
    1)
    How do I use v$lock to figure out lock details ? Details like
    whos has locked,on which table,who else is waiting, and what type
    of locking (shared or exlusive ?), since when it is locked.
    2)
    Why and when exclusive/shared locks are used ? Could you give me
    example please ?
    3)
    Could you tell me significance of v$mystat and v$locked_object ?
    4)
    Do we have page level locking in Oracle ?
    Thanks in advance,
    DN

    Details about locks : All locks acquired by statements within a transaction are held for the duration of the transaction.
    Oracle releases all locks acquired by the statements within a transaction when an explict or implied commit or roll back is executed. Oracle also releases locks acquired after a savepoint when rolling back to the savepoint.
    Note: Only transactions not waiting for the previously locked resources can acquire locks on now available resources. Waiting transactions continue to wait until after the original transaction commits or completely rolls back.
    1. How do I use v$lock to figure out lock details? Details like
    whos has locked,on which table,who else is waiting, and what type
    of locking (shared or exlusive ?), since when it is locked.
    Better way is to use Oracle OEM. The TYPE column in v$lock shows the type of wait events and we also have the LMODE column (lock mode) and REQUEST columns.
    Here is a comprehensive v$lock query by Deepak Baranwal, listing the lock types:
    set echo off
    col sid form 9999
    col id1 form 9999999999
    col id2 form 999999999
    col lmode head "Lock Held" form a14
    col request1 head "Lock Request" form a16
    col type head "Lock Type" form a15
    col ctime head "Time|Held" form 999999
    col block head "No Of |Sessions|Waiting|For This|Lock" 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, block
    from
    v$lock
    where sid>5
    and type not in ('MR','RT')
    order by decode(request,0,0,2),block,5
    2 .Why and when exclusive/shared locks are used ? Could you give me
    example please ?
    Exclusive Lock Mode : Prevents the associates resource from being shared. This lock mode is obtained to modify data. The first transaction to lock a resource exclusively is the only transaction that can alter the resource until the exclusive lock is released.
    Share Lock Mode : Allows the associated resource to be shared, depending on the operations involved. Multiple users reading data can share the data, holding share locks to prevent concurrent access by a writer (who needs an exclusive lock). Several transactions can acquire share locks on the same resource.
    Oracle Lock Types
    DML locks (data locks)
    DDL locks (dictionary locks)
    Oracle Internal Locks/Latches
    Oracle Distributed Locks
    Oracle Parallell Cache Management Locks
    3. Could you tell me significance of v$mystat and v$locked_object ?
    v$locked_object show the information about Who is locking and what object they locking. This view is similar to v$mystat except that it shows cumulated statistics for all sessions.
    4. Do we have page level locking in Oracle ? No
    Sachin

  • The apple account number had the question to lock the account number

    The apple account number had the question to lock the account number

    Try resending the verification email by going to https://appleid.apple.com, click Manage your Apple ID, sign in, click on Name, ID and Email addresses on the left, then to the right click Resend under your Primary Email Address.

  • A string of question about Locking & Isolation Level

    Hi All
    It is highly appreciated if someone give offer answers to my below questions
    1) There are two ways of locking mechanism: Pessimistic & Optimistic. In general, do all J2EE app server support all these two ways of locking ?
    2) It seems to me that setting the isolation level to "serialization" should result in using pessmistic locking. If no so, please point out my misconcept and explain to me.
    3) Are there any differences in the way of entity bean programming as different locking mechansim is adopted ?
    4) With regard to optimistic locking, will the app server throw out exception as data contention is detected ? Is the way of handling dependent on app server? Or It is transparent to the developer of entity bean. Please give me an e.g of j2ee app server product how to handle this scenario.
    5) To adopt the approach of "optimistic" locking, do l have to implement it on my own using bean managed entity bean.
    6) It seems to me that optimistic locking can achieve better concurrency. If it is inherently supported by app server for its container managed entity bean (=> totally transparent to the developer of entity bean). Is it always the rule of thumb to config the server to use "optimistic" locking instead of "pessimistic" ?
    Sorry for bombarding you guys with such long list of questions. l would be very thankful if someone can help me consolidate my concept on these topics.
    Also, please send your reply to [email protected] as well
    thanks & regards
    Danny

    Hi Danny,
    I became interested about the optimistic locking recently. If the topic is not long forgotten then this may make some difference!
    We have attacked the optimistic locking issue by introducing audit fields (MODIFY_BY_USER, MODIFY_DATE) in tables where concurrency needs to be implemented.
    We are retrieving rows from the table (for display or update) through Stateless Session Bean using simple SQL SELECT. The audit fields are fetched along with the business data and are kept at the client. While any of the concurrent users tries to update the row the audit fields are sent to the application server along with the modified business data. The relevant Entity Bean checks for any difference in the timestamp of the audit field (MODIFY_DATE) value with the value in the database. If a mismatch is found it reports a business exception to the user. Otherwise, the row is updated with the lastest timestamp value in the audit field MODIFY_DATE.
    This works fine when two update operations are not concurrent, i.e., two users submit their update requests in a time lag greater than the time taken by the transaction to complete. This alone could not prevent the dirty update on the database.
    Hence, to prevent any concurrent update contending for the same row you need to set the following ejbgen tag in the Entity Bean:
    concurrency-strategy = Exclusive<<<<<Note: We are using Weblogic 6.1 with SP4 and CMP (no BMP).
    Please let me know if you have got a better solution to tackle this issue.
    Chandra.

  • Question about locking order during merge statement

    Dear all.
    I have a merge query with a decedent hint to prevent deadlock with another queries.
    Another queries use select ~for update with same hint.
    My question is that the locking order will follow the hint in this query?
    Or I might use the select ~ for update before this merege.
    Please give any advice about select ~for update and locking order in the query.
    Thanks.
    MERGE INTO  A
    USING
         (SELECT /*+ index_desc(C index_key) */ *
         FROM
             C
          WHERE key > :start and key < :end
        ) B
         ON  ( A.KEY = B.KEY )
    WHEN MATCHED THEN
         UPDATE
         SET A.v1 = B.v1

    What you are doing is not going to prevent a deadlock in your, as yet, unknown version of Oracle. Reading an index does not cause deadlocks. Trying to alter an uncommitted row does.
    I would suggest you code this correctly by doing a SELECT FOR UPDATE WAIT <seconds> in all transactions.
    http://www.morganslibrary.org/reference/deadlocks.html#dlfu

  • Acrobat Pro 8 question to lock downloaded pdf to computer.

    Hello to everyone.
    I am interested in Adobe Acrobat Pro 8 for Mac, but I have a question which needs an answer to.
    Can you lock a pdf in Acrobat Pro 8 to the computer used to download the file? I was told by a sales rep that if you exclude the ability to print, copy, edit, and move a pdf file in Acrobat Pro 8 this will lock the file to the specific computer used to download it. Is this statement correct? I am trying to find out with a definitive yes or no. Thanks for any and all help.
    Cory

    Alternatively, look at using digital signatures and the security
    policies. This method ensures that only the person with the matching
    certificate can open the file and have specific options ...
    It would involve swapping digital ID files but once set-up, it's very
    powerful ... just uses Acrobat 8 and even Reader ..
    Jon

  • TS2446 cant remember security question been locked out help

    i cant remember my security questions eg first teacher etc been locked out please help

    Check the AppleCare number for your country here:
    http://support.apple.com/kb/HE57
    Call them up, and let them know you would like to be transferred to the Account Security Team.

  • I forgot my my security questions apple locked my account for 8 hours

    MY account security questions were right but apple said thewe were wrong and now the account is locked and I can't access the part to change the answer

    You need to ask Apple to reset your security questions; this can be done by clicking here and picking a method, or if your country isn't listed, filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (109552)

  • Questions regarding Lock Objects.

    I am creating a custom table and I want to implement a unique ID for my table and I want to use the technique of auto-increment. I created a seperate table where to store the increments to be used as IDs. So basically, when a new data is going to be saved on my other table, the program will query the next "id" from the table for increments. I have to make sure that the updating and reading of the data from the table is accessed one at a time to rule out the possibility that there will be no duplicate IDs generated.
    I have read about shared locks and exclusive locks which would serve as a solution for my purpose. The question is: is it possible for other users to "read" from a table if it is currently in an "exclusive lock" by another user?

    >
    it2051229 wrote:
    > I am creating a custom table and I want to implement a unique ID for my table and I want to use the technique of auto-increment. I created a seperate table where to store the increments to be used as IDs. So basically, when a new data is going to be saved on my other table, the program will query the next "id" from the table for increments. I have to make sure that the updating and reading of the data from the table is accessed one at a time to rule out the possibility that there will be no duplicate IDs generated.
    >
    > I have read about shared locks and exclusive locks which would serve as a solution for my purpose. The question is: is it possible for other users to "read" from a table if it is currently in an "exclusive lock" by another user?
    No it isn't.
    When you've selected your current value with SELECT FOR UPDATE (to get the exclusive lock) then every other reader will have to wait.
    But is this really what you want?
    Putting locks on something like an increasing number that is just used for an internal ID?
    This will do nothing but turn your multiuser database application into a one-by-one slowness.
    Instead, check the documentation about SEQUENCES.
    These database objects were made for this. Lockfree increasing (or decreasing) numbers for unique ID columns.
    Easy to use. Safe to use.
    In 99.9% of all cases this is what you should use.
    regards,
    Lars

  • Two basic questions about locks in Oracle.

    Hello,
    This is about 9i and onwards.
    I need to develop a comprehensive analysis of locks and waits and while doing so, following questions popped up.
    1) What is the difference between locks and waits?
    2) There is a DBA view called DBA_BLOCKERS. The standard Oracle documentation has only one line comment about this view i.e. "DBA_BLOCKER – Shows non-waiting sessions holding locks being waited-on by other sessions.
    My question is : Why would a non waiting session hold locks after all? I guess that automatically repeats the question #1 from above, What is the difference between "being waited on" v/s "holding locks with wait" and "holding locks without waits"?
    Thanks,
    R

    1) What is the difference between locks and waits? Lock - something you queue up to get and simply wait until it is available
    Waits - Waiting for a Specific event to happen before it can proceed.
    Re: Difference between a latch and a lock
    2) There is a DBA view called DBA_BLOCKERS. The standard Oracle documentation has only one line comment about this view i.e. "DBA_BLOCKER – Shows non->waiting sessions holding locks being waited-on by other sessions.DBA_BLOCKERS displays a session if it is not waiting for a locked object but is holding a lock on an object for which another session is waiting.
    HTH
    -Anantha

  • 10.1.3 errors - since my last question was locked by a mod - despite not being answered

    Quote:
    frustratedbutopenAug 27, 2014 6:17 AM
    Wow. Apple really screwed up the program this time. Here's some of my new problems.
    1. PDF's no longer cycle through the pages in the viewer window. You can't skim the pages, find the one you need, and drop it in. I do a lot of training videos using PDFs to show pages of manuals and whatnot. This makes my edits a real PITA
    Video of error: http://youtu.be/tpAQC2wUmEg
    2. 24p footage strobes in the viewer, in the scopes, and while editing the footage. Timeline set to 24p.
    Video of error: http://youtu.be/IfdxthOF0Z8
    3. Can't import C300 footage anymore. This is a screenshot of my import window when looking at a C300 card. I have the latest Canon drivers and utilities installed on my system
    The combination of these three issues has made it almost impossible to use this program anymore. It can no longer do what I need it to do.
    Does anyone have any ideas - besides moving over to PremierPro, which I have just purchased as of this morning?
    Then Tom Wolsky replied:
    Tom Wolsky     Aug 27, 2014 7:03 AM  Re: New problems with 10.1.3 - 24p footage strobing, among others...
      Re: New problems with 10.1.3 - 24p footage strobing, among others...  in response to frustratedbutopen      
    What did you upgrade from? What are your system specs?
    I'm not seeing the strobe in the 23.98 media. Maybe YouTube is suppressing it.
    Only seen C300 media once but that doesn't look like a complete folder structure.
    I'm sure you'll be happy with Premiere.

    Tom - in answer to your questions,
    The strobing is there when I watch the video on youtube. I can post a higher rez clip, but its apparent on the scope.
    1. I upgraded from 10.2.1. MacPro 3.5 6-core Xeon E5, 32 GB 1867 DDR3 (Mavericks, obviously)
    2. That's the card - taken directly from the C300 and stuck into the card-reader. Footage opens just fine in PPro
    3. "Sure you'll be happy with Premiere" C'mon man. What kind of boneheaded reply is that? That's a typical apple egghead "pi$s off". It would be great if assistance could be offered without the snobbery, but thanks for living up to the stereotype. I have invested in X from the get-go. I've had X installed since it came out and I made the commitment to learn it and use it as the edit-backbone of my projects. I dumped 5 figures into 3 MPro trashcans - all running x - because I believed enough in this product to do so. You're doing Apple a disservice by being so dismissive and smug.
    I mentioned that I bought PPro because as of this latest update, X is creating enough trouble in my workflow to where it is costing me time and time is money. Look at the issues with 10.1.3 that are being posted just in this forum. If you can't see that there may actually be some issues with the software, then maybe you need to loosen your beret a bit.

  • Question on Lock in In-Doubt Transaction

    Dear All,
    Could you kindly explain me why distributed transaction imposes a lock on read also with write? During Read, Select statement also uses rollback segment.
    But in the document “Oracle9i - Database Administrator’s Guide Release 2 (9.2) - March 2002 Part No. A96521-01” at page 31-16, it has been written that
    “the data is locked for both reads and writes. Oracle blocks reads because it cannot determine which version of the data to display for a query.”
    So could we come to a conclusion that distributed transaction does not use rollback segment.
    But at page 31-18, under manual resolution of In-Doubt Transaction, the first point is that the in-doubt transaction has locks on critical data or rollback segment.
    Therefore, rollback segment is using during distributed transaction. So why does Oracle impose a lock on READ the data?
    Regards,
    Student

    Redo logs are effectively write-only under normal circumstances. The database NEVER goes back to read the redo log unless it is in crash recovery mode.
    Therefore, even though the information has been recorded in the online redo log, that information can not be used to roll back a failed in-doubt transaction. The rollback information MUST come from the rollback segment or from some other online location.
    (I am not taking this as an argument - it's helping me as well.)

  • Question on locked audio regions

    I saw a Logic 7 video a few days ago in which a locked audio region had its start point dragged to the right. This process shortened the region but left the new region with exactly the same bar/timecode position as before. I don't seem to be able to do this in Logic 9. Has this facility been removed?

    ...but in the video I mentioned the locked region's front end was dragged while the region was still in the arrangement window. That looked a really handy feature and I still can't work out if it's still possible in Logic 9.

  • Numbers iOS Question RE: Locking Tables & Charts

    I've created a number of tables and charts on the iPad to be used for an anesthesia record template.  How do I lock the tables and charts so that they don't inadvertently get moved or disturbed?

    iOS version doesn't have the lock ability.
    Jason

  • Question about locking certain folders w/diff.accounts?

    I'm about to let my girlfriend use my Mac, so I made a seperate account for her. I just don't want her going through all of my files and " stuff ". Is there anyway to lock certain folders in my account? I tried using parental controls but didn't find the file I wanted to Lock in the options.

    Hi Aaron
    When your girlfriend is logged in on her account your folders are locked to her. Your Home folders are only accessible from your account.
    Matthew Whiting

  • HELP! Question about "Locking" ipod

    I am an elementary teacher that is trying to get ipods integrated into the school curriculum, school administrators have expressed concerns about students putting inappropriate content onto the ipods, is it possible to "lock" unauthorized editing on an ipod, possibly password protection, or only allowing it to be updated on one cpu?

    No, it's not possible to do what you want.
    There is a screen lock that locks the iPod so another user can't use it without a code being entered, but this would lock the whole iPod.
    There's no way to selectively lock specific content, either adding it or viewing it.

Maybe you are looking for

  • How to use one forms fields, program units in another form.

    The whole proceessing and update is happening in one main form. Main form has all the fields and a reprocess button which re-creates records if they have error. Record name is the primary key. I have another small form, which just shows the list of r

  • Deactivation of Document Splitting

    Hi Gurus, We are doing are integration testing and having document splitting activated. But now i understood that the design which client is having, profit center is required in Profit and loss items and in balance sheets, profit center is not at all

  • How do you change MS Word to pdf file?

    I have just signed up for the free adobe xi which told me from the outset that I could use it to make a pdf file. I can't figure out where to find out how to do this.

  • Applet security issue in version "1.5.0_05-b05"

    Dear all, I have a problem to run my applet since I downloaded the last version of jdk. This applet was running on version "jdk-1_5_0_02" but now I get access denied for SocketPermission and for FilePermission ( java.security.AccessControlException:

  • Webmin Default Password

    After reading the thread concerning Solaris Webmin (http://forum.sun.com/thread.jspa?forumID=271&threadID=22658) I decided to give it a try. Running /usr/sfw/bin/webminsetup asks for the default login, but doesn't ask you to set a password. Then as t