title: Progress 4GL Exclusive Lock Not Releasing
body: <p>I'm using proserve to enable multiple-user session.
  This is my code in a mouse double-click trigger on my browse:</p>
  
  <pre><code>  DO WITH FRAME MAIN-FRAME:
      IF EMP-BROWSE:NUM-SELECTED-ROWS &gt; 0 THEN
      DO:
          EMP-BROWSE:FETCH-SELECTED-ROW(1).   
          FIND CURRENT EMPLOYEE NO-ERROR NO-WAIT.        
          IF AVAILABLE (EMPLOYEE) THEN
          DO:                 
              DO TRANSACTION ON ERROR UNDO, LEAVE:
                  C-Win:SENSITIVE = NO.        
                  FIND CURRENT EMPLOYEE EXCLUSIVE-LOCK.
                  MESSAGE STRING(EMPLOYEE.emp-num) + " locked.".                    
                  C-Win:SENSITIVE = YES.   
              END.    
              RELEASE EMPLOYEE.                     
          END.
          ELSE IF NOT AVAILABLE (EMPLOYEE) THEN
          DO:
              MESSAGE "The employee details is currently in-use in another session. Please try again later." VIEW-AS ALERT-BOX TITLE "System Message".
              RETURN NO-APPLY.
          END.
          ELSE
          DO:
              MESSAGE "The record has been deleted in another session.".    
              RETURN NO-APPLY.
          END.      
      END.
    END. 
  </code></pre>
  
  <p>SCENARIO:
  <br>
  Session A double clicks on browse record 1. It will then message something like "2001 locked." after that Session B double clicks on browse record 1 and it will fire the message at the <code>IF NOT AVAILABLE (EMPLOYEE)</code> block.
  <br>
  <br>
  My question is shouldn't the <code>RELEASE EMPLOYEE</code> code enable session B to access the same record? 
  <br>
  <br>
  I have also tried <code>FIND CURRENT EMPLOYEE NO-LOCK</code> and putting either of the code inside and outside the <code>DO TRANSACTION</code> block but nothing happens.
  <br><br>
  EDIT:
  <br>
  I applied these changes but in the same scenario, Session B gets the message on the <code>ELSE</code> block which is <code>MESSAGE "The record has been deleted in another session.".</code> What am I doing wrong here? 
  <br><br> When I add a call to a new window <code>RUN newWindow.w.</code> after <code>MESSAGE STRING(EMPLOYEE.emp-num) + "locked.".</code>, with the same scenario while not closing the new window on Session A I get a proper response of the record being used in another session in Session B.
  <br></p>
  
  <pre><code>DO WITH FRAME MAIN-FRAME:
      IF EMP-BROWSE:NUM-SELECTED-ROWS &gt; 0 THEN
      DO:        
          EMP-BROWSE:FETCH-SELECTED-ROW(1).   
          FIND CURRENT EMPLOYEE NO-LOCK NO-ERROR NO-WAIT.        
          DEFINE VARIABLE iOk AS LOGICAL NO-UNDO.
          DEFINE BUFFER myEMPLOYEE FOR EMPLOYEE.
          iOk = NO.
          DO FOR myEMPLOYEE TRANSACTION:
          FIND myEMPLOYEE WHERE myEMPLOYEE.emp-num = EMPLOYEE.emp-num EXCLUSIVE-LOCK NO-ERROR NO-WAIT.
          IF AVAILABLE (myEMPLOYEE) THEN
          DO:
              IF LOCKED (myEMPLOYEE) THEN
              DO:
                  MESSAGE "The employee details is currently in-use in another session. Please try again later." VIEW-AS ALERT-BOX TITLE "System Message".
                  RETURN NO-APPLY.
              END.
              ELSE
              DO:
                  C-Win:SENSITIVE = NO. 
                  MESSAGE STRING(EMPLOYEE.emp-num) + " locked.". 
                  C-Win:SENSITIVE = YES.   
              END.
          END.
          ELSE
          DO:
              MESSAGE "The record has been deleted in another session.".    
              RETURN NO-APPLY.
          END.
      END.
      END.
    END.  
  </code></pre>