Checking locks in RVKRED77 / RVKREDSP / Z_RVKRED77_PARALLEL

We're facing challenges in credit master reorgs (I'm posting this for a colleague, so please bear with me).
After looking at relevant notes (363343, 400311, 755395) and searching the forum, I wonder if anyone has found logic missing from the SAP suggested code.  When we run this, there may be a condition that does not permit the tables to be locked, so we wait and start the entire job again.  Within Z_RVKRED77_PARALLEL, these enqueue locks are tried:
CALL FUNCTION 'ENQUEUE_EVVBAKE'
       EXPORTING
            vbeln = con_enqueue_batch.
  CALL FUNCTION 'ENQUEUE_EVVBAKE'.
  CALL FUNCTION 'ENQUEUE_EVVBLKE'.
  CALL FUNCTION 'ENQUEUE_EVVBRKE'.
  IF NOT variant1 IS INITIAL.
    PERFORM fill_joblist USING variant1 user '1'.
  ENDIF.
But there is no check on success/failure.  I was thinking of adding a "delay and retry" within this block so we could attempt to continue at that point.  Good, bad, crazy?
Thanks,
Jim

Hi Jim,
Perhaps you need write the unlock, because I understand that you have problems with locks, ie, in RVKRED07 you have this coding:
  IF noblock IS INITIAL.
    CALL FUNCTION 'DEQUEUE_EVVBAKE'.
    CALL FUNCTION 'DEQUEUE_EVVBLKE'.
    CALL FUNCTION 'DEQUEUE_EVVBRKE'.
  ENDIF.
For instance
IF NOT variant1 IS INITIAL.
    CALL FUNCTION 'DEQUEUE_EVVBAKE'.
    CALL FUNCTION 'DEQUEUE_EVVBLKE'.
    CALL FUNCTION 'DEQUEUE_EVVBRKE'.
   " WAIT UP TO 2 SECONDS.                                 "try it, perhaps you avoid problems
   PERFORM fill_joblist USING variant1 user '1'.
ENDIF.
Other suggestion. Perhaps it will easier to call RVKRED77 because it call RVKRED07 (ie: report   LIKE sy-repid VALUE 'RVKRED77', ), well, it's an idea how to do more simple the maintenance of variants.
Well, I hope this helps you
Regards,
Eduardo
PD: I'm thinking, and perhaps if you see that locks are losing in SM13, you can do this:
IF NOT variant1 IS INITIAL.
    "DELETE LOCKS
    CALL FUNCTION 'DEQUEUE_EVVBAKE'.
    CALL FUNCTION 'DEQUEUE_EVVBLKE'.
    CALL FUNCTION 'DEQUEUE_EVVBRKE'.
    "Call the reorg. with its own locks / unlocks
    PERFORM fill_joblist USING variant1 user '1'.
    "Set newly the locks
    CALL FUNCTION 'ENQUEUE_EVVBAKE'
      EXPORTING
        vbeln = con_enqueue_batch.
    CALL FUNCTION 'ENQUEUE_EVVBAKE'.
    CALL FUNCTION 'ENQUEUE_EVVBLKE'.
    CALL FUNCTION 'ENQUEUE_EVVBRKE'.
ENDIF.
Edited by: E_Hinojosa on Nov 12, 2010 12:54 PM

Similar Messages

  • LMS 3.2 install (windows) - checking locked files

    I'm at a point in the LMS 3.2 install where it looks like its hung on the "Checking locked files...." step. How long should I expect this process to take? It's been going for an hour and I haven't seen anything going on.

    I agree with the praise for the answer, I had the same issue and found out this workaround myself before seeing this topic.
    But it's still a nasty workaround: I don't really want to set the daemon temporarily to Manual for each update. Does Cisco acknowledge this as a bug and resolve it in a next release?

  • Double-Checked Locking

    Hey everyone,
    I posted a blog entry using Double-Checked Locking. Later one, Ryan commented to me that DCL does not work. See
    http://jroller.com/page/davinci/?anchor=lazy_initialization_with_less_pain
    I never knew that. Anyway, in a small efford to fix this I came up with the following code. Now one of the articles stated that many clever people already tried to fix the problem, and since I don't think I'm that smart, I guess this code also doesn't work. Can anyone explain to me why the following code could go wrong on some JVM's and platforms?
    private class Singeton {
      private static Singleton SINGLETON;
      private static boolean initialized;
      public static Singleton getInstance() {
         if (!initialized) {
           synchronized (Singleton.class) {
             if (SINLETON == null) {
               SINGLETON = new Singleton();
           initialized = true;
         return SINGLETON;
    }Thanks,
    Vincent

    Okay, this migth seem like a load of... well, you
    know, but in this case I force the JVM to initialize
    the object before setting the boolean to true, or
    not?Did you read the link I posted?
    "The most obvious reason it doesn't work it that the writes that initialize the Helper object and the write to the helper field can be done or perceived out of order. Thus, a thread which invokes getHelper() could see a non-null reference to a helper object, but see the default values for fields of the helper object, rather than the values set in the constructor.
    If the compiler inlines the call to the constructor, then the writes that initialize the object and the write to the helper field can be freely reordered if the compiler can prove that the constructor cannot throw an exception or perform synchronization.
    Even if the compiler does not reorder those writes, on a multiprocessor the processor or the memory system may reorder those writes, as perceived by a thread running on another processor. "
    Your code still fails. There is no known solution to the problem (if you can't create the singleton during declaration time)
    /Kaj

  • A way to make double-checked locking work?

    First a little background.
    I am writing an application that will run in an websphere/db2 environment. This application needs to provide a lot of referential data to the UI to properly populate certain fields (on the order of several dozen reference data requests per page request with about 3-400 concurrent users). To prevent 20 sql statements for a single user clicking a single link, I implemented a dynamic caching scheme with double-checked locking, not realizing the potential danger.
    After reading an article I found on the pitfalls of double-checked locking (http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-toolbox.html), I still would like to prevent synchronizing on every cache request. I think I've found a solution that transfers the weight to the write operations, as those would be much less frequent and can therefore take the bigger load. I would like to see if anyone can find a hole in this.
    public class DCLTest {
      private Resource rec = null;
      boolean initializing = false;
      public Resource getResource() {
        Resource temp = null;
        if (rec == null) {
          synchronized (this) {
            // initializing is now synchronized w/ main memory
            if (initializing)
              wait();
            if (rec == null) {
              // resource has lots of non-trivial datamembers that get initialized in the constructor
              temp = new Resource();
              initializing = true;
          // If initializing is true, we know it's set by this thread,
          // but still check that temp is valid
          if (initializing && (temp != null)) {
            synchronized (this) {
              rec = temp;
              initializing = false;
              notifyAll();
    }The first synchronize block establishes the first set of boundaries. When it completes, the initializing flag is raised and any other thread waiting to enter that block will see the flag and wait. Also, when the block is executed, all of the resource object's internal fields get written to the main memory, but the "global" pointer will still be null. Once we enter the second synchronized block, we update the global pointer and reset the flag. Since both synchronized blocks synchronize on "this", calling notifyAll won't resume execution of the threads that are waiting until they re-acquire the lock on this, or in other terms, until the second synchronized block completes. By that point the initializing flag will be false, the rec field will be not null and rec's data members will be in sync between all threads trying to access it.
    This all depends on the assumption that the optimizer won't combine the two synchronized blocks. If that's the case, the two synchronized blocks assure that the reference to rec is written (and made visible to main memory) after the actual contents of rec are in main memory. Therefore, if a reading thread acquires a non-null value in the check outside the synchronized block, it will acquirea proper value. Otherwise, it'll get a null and will enter the synchronized block and all is well.
    This logic seems too good to be true (which unfortunately means it probably is), but I can't find the hole. The only justification my gut can give this is the fact that the write operation becomes slower than if both read and write were synchronized, which is acceptable in my case.

    a big flaw (but easily solvable) is that there is no
    guarentee that changes made to your "initializing"
    variable
    will ever be seen by other threads. It needs to be
    marked volatile.this is not true. the JLS states that all threads are required to load from main memory on the first use of a variable in its lifetime. This would happen the first time a thread checks rec. When that check occurs, it will load from main memory and eihter get a null and enter the sync block, or get a valid reference and continue.
    17.3 After a thread is created, it must perform an assign or load action
    on a variable before performing a use or store action on that variable.
    A second flaw is that you never set rec to anything
    other then null.
    ( a single thread will enter the first synch block and
    obtain a reference to temp. It will then NOT enter
    the
    second synch block as initializing is false. hence
    your rec variable will be null)why is initializing false? it's set to true within the first block.
    temp = new Resource();          
    initializing = true;
    Third.
    rec is null. The first thread enters the first synch
    block and stops before changing the initializing
    valriable. A
    second thread then tries to enter the synch block. It
    cannot get the monitor and therefore yeilds. The first
    thread then continues inside the synch block. It just
    leaves the first synch block before being stopped. The
    second thread then resumes. It obtains the lock on the
    first sych block. initilaizing is false so it skips
    the
    wait() statment. Rec is still null so the second
    thread creates a new one. Now you have two threads
    each has
    a local reference to different Resource's. Which one
    gets used? (actually at the moment niether would
    get used cos of the previous problem)the whole idea of initializing is that it never gets written outside of a synchronized block. if a thread cuts in just as the first thread left the first sync block, initializing is set to true, so it will simply wait. This is to make sure that no one does anything while the thread that's initializing is in between the two sync blocks.
    i think you overlooked where initializing is set to true in the first block

  • Fixing Double-Checked Locking using Volatile

    Oooh - what a scandalous subject title! :)
    Anyhow, I was expanding my knowledge on why the double-checked locking idiom used in Singleton classes fails (after reading that JSR-133 is not going to fix the problem!), when I read http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html and found a spicy section titled "Fixing Double-Checked Locking using Volatile" (at the very bottom of the document).
    As it is quite hard to find information (all sources revisit all the basic problems), I was wondering if anybody could back this up/refute it.
    Just one more thing. I anticipate that many people who are researching this matter would like to have this clarified, so it would be beneficial to keep posts very much on topic. There is already a lot of information available about double locking failures in general.
    The problem this post faces lies in a lot of statements saying "using volatile will NOT fix double-checked locking" that refer (I think) to the current JDK.
    Thanks heaps!

    Volatile only checks that not more than one thread is accessing the variable at the same time (amongst other things of course), so in the example, it could cause problems. Let me explain a little here. Given a situation where two threads wish to aquire the Helper:
    Step 1: Thread 1 enters the method and checks the helper status
    and sees that it is null.
    private volatile Helper helper = null;
    public Helper getHelper() {
      if (helper == null) { // <!-- Thread 1 requires helper, and sees that it is null
         synchronized(this) {
            if (helper == null)
               helper = new Helper();
       return helper;
    }Step 2: Thread 2 enters the method, before the lock can be
    acquired on the this-object and notices that the helper is
    null.
    private volatile Helper helper = null;
    public Helper getHelper() {
      if (helper == null) { // <!-- Thread 2 requires helper also
         synchronized(this) { // and it is still null
            if (helper == null)
               helper = new Helper();
       return helper;
    }Step 3: The first Thread creates a new Helper
    private volatile Helper helper = null;
    public Helper getHelper() {
      if (helper == null) { // <!-- Thread 2 waiting for lock realeas
         synchronized(this) {
            if (helper == null)
               helper = new Helper(); // <!-- Thread 1 creating new Helper
       return helper; //
    }Now for Step 4, there are a few possibilites here. Either Thread 1 returns the helper it created, or Thread 2 can create the new Helper before the Thread 1 returns the Helper. Either way, the result is unwanted.
    private volatile Helper helper = null;
    public Helper getHelper() {
      if (helper == null) {
         synchronized(this) {
            if (helper == null)
               helper = new Helper(); // <!-- Thread 2 creating new Helper
       return helper; // <!-- Thread 1 returning Helper
    }The code can also create interesting situations (deadlocks?) due to the synchronized(this) statement used in a ... creative way in this case.
    I might be wrong of course. Just my �0.02.
    Tuomas Rinta

  • How to check locked session?

    Hi all,
    How do I check locked session,or which tables has been locked.and how to kill the lock session. i would need to do it in sqlplus. we'r not allowed to use toad.

    SELECT sess.osuser AS OsUser, NVL (sess.program, sess.module) AS
    Program, sess.terminal AS Terminal,
    obj.Object_Name AS TABLE_NAME,
    DBMS_ROWID.rowid_create (1, ROW_WAIT_OBJ#, ROW_WAIT_FILE#,
    ROW_WAIT_BLOCK#, ROW_WAIT_ROW#) AS ROW_ID
    FROM dba_objects obj, v$session sess
    WHERE sess.SID IN (SELECT a.SID
    FROM v$lock a, v$session b
    WHERE (id1, id2) IN (SELECT b.id1, b.id2
    FROM v$lock b
    WHERE b.id1 = a.id1 AND
    b.id2 = a.id2 AND b.request > 0)
    AND a.SID = b.SID
    AND a.lmode = 0)
    AND obj.object_id = sess.ROW_WAIT_OBJ#)

  • Checking Lock Status of Object before passing it to FM RH_RELATION_MAINTAIN

    hi all,
              While passing the object id to FM  RH_RELATION_MAINTAIN  if object id is locked i.e say open in a standard tcode  then,this FM terminates.
              is there any way to detect whether this Object is Locked or not before passing it to FM ??? this way i cud give the status msg that the " given object is locked" without termination the program.

    >
    Ajay84 wrote:
    > hi all,
    >           While passing the object id to FM  RH_RELATION_MAINTAIN  if object id is locked i.e say open in a standard tcode  then,this FM terminates.
    >
    >           is there any way to detect whether this Object is Locked or not before passing it to FM ??? this way i cud give the status msg that the " given object is locked" without termination the program.
    Please check the FM 'HR_ENQUEUE_OBJECT', it is well documented.
    Regards
    Rajesh.

  • How to check lock status of field in current document?

    Hi,
    How to check the status of field in current document(master agreement), that is whether its locked or not.
    I locked "Publish to Supplier" checkbox after MA is saved first time. Now, I want to check the status whether this field is locked or not in the same document.
    IsLockOwner( ) is not returning the correct value. Its not giving the current document field lock status.
    Is there any way to get current document field status?
    Thanks,
    Saloni

    Hi,
    If I understand correctly, your requirement is to get the value of this field "Publish to Supplier on". It can be achieved by writing the below:
    isVendorVisible = doc.getExtensionField("VENDOR_VISIBLE").get();
    Meaning, if the box is checked, it will return a value = true and if not then false.
    Hope this helps,
    Regards,
    Vikram Shukla

  • HT204387 how to check lock unlock status

    hello all
    how can i check status of iphone lock or unlock by imei
    if any one know help me me please

    Call AppleCare and give them the serial number.

  • Check Lock on production order

    Hi,
        before lauching the BAPI to confirm a production order in Z program, l want to check first if a lock exist on that same production order. How can l find the FM that does the job?
    Thank's for your help.
    Bob

    Hi Bob,
    In the transaction SM12 you can see all current SAP locks, they can be selected using object or user name. If you want to get that list in your ABAP, the function ENQUEUE_READ will return you a list of object locks for specific objects (that can be specified with a pattern). The function can be useful if you want to process some object without locking it, for example, with a BAPI or BDC, and you want to check whether you may do this at the moment. If the object is currently locked by another user, you can read the lock and decide what to do: wait, or just report an error.
    Regards
    Sudheer

  • Check Lock Entries

    Hi Friends,
    I have run two programs simultaneously updating same table.I want to chaek whether there is any lock that has occured.I have no authorization for SM12.Is there any table or other transaction to check whether the table is locked.

    Hi!
    The programs should set lock entries before making a change and releasing the lock immediately afterwards. When this is the case, you could see locks in SM12, but more for information purpose - because the programs are doing well on their own.
    If one (or both) programs don't use locks, then you won't see anything in SM12 and you might get a mess in the database - depends on the actual changes.
    (IMHO) Locks aren't stored in a table, it's more organized like a global memory -> that's faster and locks don't need to be stored for a long time anyway.
    Transaction would be SM12 - and anyway, any other transaction would check the same authority object...
    Regards,
    Christian

  • How to check Locking sessions in oracle 10g

    Hi,
    I have tried to get locking sessions. i got the blocking session by using v$lock view.
    Pls help how to get locking sessions.
    Regards,
    Venkat

    Hi Venkat
    Or just run this independent of database version
    select a.sid blocker, 'is blocking the session ', b.sid blockee from v$lock a, v$lock b
    where a.block =1 and b.request > 0  and a.id1=b.id1 and a.id2=b.id2;You can extend this query to find the username and machine (plus all other details) from v$session using the a.sid and b.sid from above
    To find the blocking session_
    SELECT S.SID, S.SQL_ID, S.USERNAME, S.MACHINE from
    V$SESSION S WHERE S.SID  = (SELECT blocker from
    (select a.sid blocker, 'is blocking the session ', b.sid blockee from v$lock a, v$lock b
    where a.block =1 and b.request > 0  and a.id1=b.id1 and a.id2=b.id2
    *_To find the blocked session_*SELECT S.SID, S.SQL_ID, S.USERNAME, S.MACHINE from
    V$SESSION S WHERE S.SID = (SELECT blockee from
    (select a.sid blocker, 'is blocking the session ', b.sid blockee from v$lock a, v$lock b
    where a.block =1 and b.request > 0 and a.id1=b.id1 and a.id2=b.id2
    Edited : Added blocker and blockee code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Double check locking using Volatile.

    Hi gurus,
    Please suggest if the following lazy loading would work.
    public CommandFactory{
           private static volatile ICommand command= null;
           private static ICommand instanceCommand = null;
           public static ICommand getCommand(){
                      if(instanceCommand == null){
                             synchronized(CommandFactory.class){
                                  if(instanceCommand == null){
                                      command = new Command();
                                      instanceCommand = command;
               return instanceCommand;
    }

    For danny like "Boss of Talented people..lol...lmao....." understand
    The Double checking with Volatile which would work with the new improved volatile contract.
    public CommandFactory{
           private static volatile ICommand command= null;
                  public static ICommand getCommand(){
                      if(command== null){
                             synchronized(CommandFactory.class){
                                  if(command== null){
                                      command = new Command();
               return command;
    }And the code I wrote which isn't any good as per JTahlborn is here
    public class CommandFactory {
         private static volatile ICommand command = null;
         private static ICommand instanceCommand = null;
         public static ICommand getCommand() {
              if (instanceCommand == null) {
                   synchronized (CommandFactory.class) {
                        if (instanceCommand == null) {
                             command = new Command();
                             instanceCommand = command;
              return instanceCommand;
    }

  • Speed checker locks up in testing mode.

    Hi,
    I posted a message a week or so back about how the speed tester didn't recognise my land line.
    It gets past that part now, and I get a screen saying testing, but not the usual indicators, it just remains testing.
    Anybody got any ideas?
    George
    Solved!
    Go to Solution.

    Solved (I don't know how though)
    They say that if you want a fault fixed, report it, and when it's tested it will be RWT.
    After nearly a week of not working it's back to normal.
    George

  • [Help] How to check the object locks held by a specific thread?

    As the title I want to check locks held by a specific thread. How can I do this? In Java lock is acquired and release automatically by stating synchronized keyword. I have no idea on how to check the lock status and who owns whick lock.
    Regards,
    Skeeter

    Look for the method:
        public static native boolean holdsLock(java.lang.Object);Its in the java.lang.Thread class. It will check the lock status for an object for the calling thread.

Maybe you are looking for

  • Ichat 5.0.3 transfer not working

    Hey there! Having a issues with iChat 5.0.3 (745) in Snow Leopard. I can always accept files, but when i send file to people, sometimes they will go through, sometimes it will give me an error message "failed"

  • I am running Mac 10.5.7 in PSE 4.0

    How do you get a png file to not open PSE. I want it to open in preview. How do you do that? When i drop a photo in PSE 4.0 and i work on it and save as png and drop it to my desktop and then i click on it it opens PSE. I want it to open preview.Help

  • How to Commit in InfoBus Data Items

    Hi, I created an Applet using JDev2.0. I called the DB schema using Connection Manager, InfoBus Data Items, SessionInfo and rowSetInfo. I customised the UI form using Infoswing. As per my logic, after user modified the data and press the SUBMIT butto

  • DB-Table PO for time to confirm for each actvity type (operation)

    Hello All, I search the DB-Table for the time to confirm for each activity type (operation/production order). (CO03>operation details>qty/activities-->to confirm). I have found the following tables - but without success: AFRU AFVC AFVV PLPO I search

  • I just down loaded iOS 6 on my iphone4. Is Siri not avialable for this version?

    I just downloaded iOS6 on my iphone 4. I did not get Siri. Is it not available on the iphone 4??