title: PLSQL UPDATE statement in LOOP takes forever
body: <p>If I execute</p>
  <pre><code>UPDATE person 
  SET CUSTOM2 = TIMESTAMP_DIFF(SYSTIMESTAMP,TO_TIMESTAMP (CUSTOM1, 'YYYY-MM-DD HH24:MI:SS.FF')) 
  WHERE  person.id = 'p01';
  </code></pre>
  <p>it updates fine but if I execute update statement inside the loop it hangs forever</p>
  <pre><code>DECLARE
     
      TYPE person_ids_t IS table of person.id%type index by PLS_INTEGER;
      ids_collection person_ids_t;
      CURSOR cur  IS  select id from person where CUSTOM1 is not null;
     
  BEGIN   
      OPEN cur;   
     
  --    LOOP   
          FETCH cur   BULK COLLECT INTO ids_collection   LIMIT 10;   
  --        EXIT WHEN ids_collection.COUNT = 0;   
     
          FORALL idx IN 1 .. ids_collection.COUNT
              UPDATE person 
              SET CUSTOM2 = TIMESTAMP_DIFF(SYSTIMESTAMP,TO_TIMESTAMP (CUSTOM1, 'YYYY-MM-DD HH24:MI:SS.FF')) 
              WHERE  person.id = ids_collection(idx);
     
        COMMIT;   
  --   END LOOP;  
     CLOSE cur;  
  END;
  </code></pre>
  <p>When I execute above block, ScriptRunner hangs forever and I have to force quit.
  Not sure why.</p>
  <p>even changing the script to</p>
  <pre><code>set SERVEROUTPUT ON;
  DECLARE
      c_id person.id%type;
      CURSOR cur  IS  select id from person where CUSTOM1 is not nul;
      
      vcount integer :=0;
     
  BEGIN   
      OPEN cur;   
     
      LOOP 
          FETCH cur into c_id;
          EXIT WHEN cur%notfound; 
   
     
         
  --        UPDATE person 
  --        SET CUSTOM2 = TIMESTAMP_DIFF(SYSTIMESTAMP,TO_TIMESTAMP (CUSTOM1, 'YYYY-MM-DD HH24:MI:SS.FF')) 
  --        WHERE  person.id = c_id;
          
          dbms_output.put_line('c_id: ' || c_id); 
          
          vcount := vcount + 1;
          IF vcount = 1 THEN
              EXIT;
          END IF; 
     END LOOP;  
     CLOSE cur;  
     
     dbms_output.put_line('vcount: ' || vcount); 
     
  END;
  /
  </code></pre>
  <p>If I execute this it prints
  c_id: p01
  vcount: 1</p>
  <p>but when I uncomment the update statement it hangs forever</p>