             UPDATE json_values
             SET locked = 'T'
             WHERE id = v_ids_to_pin(v_i);
+            
+        FOR v_i IN 1..v_ids_to_pin.COUNT LOOP
+            pin_cached_value(v_ids_to_pin(v_i));
+        END LOOP;
     
     END;
     

    
    END;
    
    /* JSON query API methods */
    
    FUNCTION parse_query (

            UPDATE json_values
            SET locked = NULL
            WHERE id = v_ids_to_unpin(v_i);
            
        FOR v_i IN 1..v_ids_to_unpin.COUNT LOOP
            unpin_cached_value(v_ids_to_unpin(v_i));
        END LOOP;
    
    END;
    
