Oracle procedure sometimes runs endlessy, other times finishes instantly The procedure always compiles instantly and I'm pretty sure I don't have any infinite loops or some other bug in there. When running the procedure in SQL Developer it sometimes finishes instantly (as it should, the tables only have like 5 rows each) and other times it never stops running. Does it have to do with the DB or my code? Sorry if the code is messy, this is my first PLSQL procedure. I'm running the procedure at the Oracle DB my university provides so I don't have admin rights.
CREATE OR REPLACE PROCEDURE integrate_data IS
    rowCount NUMBER;
    currId NUMBER;
    CURSOR ws1_customer_crsr IS SELECT * FROM ws1_customer;
    CURSOR ws1_product_crsr IS SELECT * FROM ws1_product;
    CURSOR ws1_order_crsr IS SELECT * FROM ws1_order o JOIN ws1_order_position p ON o.no = p.order_;
    CURSOR ws2_customer_crsr IS SELECT * FROM ws2_user u JOIN ws2_address a ON u.id = a.user_;
    CURSOR ws2_product_crsr IS SELECT * FROM ws2_product;
    CURSOR ws2_order_crsr IS SELECT * FROM ws2_purchase p JOIN ws2_entry e ON p.code = e.purchase; 
BEGIN
    SAVEPOINT beforeProcedure;
    DELETE FROM ts_transaction;
    DELETE FROM ts_customer;
    DELETE FROM ts_product;
    /* Insert customer data from ws1 */
    FOR ws1_customer_rec IN ws1_customer_crsr
    LOOP
        INSERT INTO ts_customer VALUES('ws1_' || to_char(ws1_customer_rec.id), ws1_customer_rec.email, ws1_customer_rec.address);
    END LOOP;
    /* Insert product data from ws1 */
    FOR ws1_product_rec IN ws1_product_crsr
    LOOP 
        INSERT INTO ts_product VALUES('ws1_' || to_char(ws1_product_rec.id), ws1_product_rec.name,
            ws1_product_rec.description, ws1_product_rec.price);
    END LOOP;
    /* Insert order data from ws1 */
    FOR ws1_order_rec IN ws1_order_crsr
    LOOP
        INSERT INTO ts_transaction VALUES('ws1_' || to_char(ws1_order_rec.no) || '_' || to_char(ws1_order_rec.pos_no), ws1_order_rec.date_, 
            ws1_order_rec.quantity, 'ws1_' || to_char(ws1_order_rec.customer), 'ws1_' || to_char(ws1_order_rec.product));
    END LOOP;
    /* Insert customer data from ws2, if a customer has multiple addresses only the first one gets added */
    FOR ws2_user_rec IN ws2_customer_crsr
    LOOP
        currId := ws2_user_rec.user_;
        SELECT CASE 
            WHEN EXISTS(SELECT * FROM ts_customer c WHERE c.id = 'ws2_' || currId) THEN 1
            ELSE 0
        END
        INTO rowCount
        FROM DUAL;
        IF rowCount = 0 THEN
            INSERT INTO ts_customer VALUES('ws2_' || to_char(ws2_user_rec.user_), ws2_user_rec.email, ws2_user_rec.street || ' ' || to_char(ws2_user_rec.street_no) ||
                ', ' || to_char(ws2_user_rec.postal_code) || ' ' || ws2_user_rec.city);
        END IF;
    END LOOP;
    /* Insert product data from ws2 */
    FOR ws2_product_rec IN ws2_product_crsr
    LOOP
        INSERT INTO ts_product VALUES('ws2_' || to_char(ws2_product_rec.ean), ws2_product_rec.title, ws2_product_rec.description, ws2_product_rec.sales_price);
    END LOOP;
    /* Insert order data from ws2 */
    FOR ws2_purchase_rec IN ws2_order_crsr
    LOOP
        INSERT INTO ts_transaction VALUES('ws2_' || to_char(ws2_purchase_rec.code) || '_' || to_char(ws2_purchase_rec.entry_no),
            ws2_purchase_rec.date_, ws2_purchase_rec.qty, 'ws2_' || to_char(ws2_purchase_rec.user_), 'ws2_' || to_char(ws2_purchase_rec.product));
    END LOOP;
    EXCEPTION
        WHEN OTHERS THEN
        dbms_output.put_line('An error has occurred, all work the procedure has done has been rolled backed');
        ROLLBACK TO beforeProcedure;
END;
/
There is no commit in your code. You are likely blocking yourself if you run this twice from different concurrent sessions.
Add a commit at the end:
    /* Insert order data from ws2 */
    FOR ws2_purchase_rec IN ws2_order_crsr
    LOOP
        INSERT INTO ts_transaction VALUES('ws2_' || to_char(ws2_purchase_rec.code) || '_' || to_char(ws2_purchase_rec.entry_no),
            ws2_purchase_rec.date_, ws2_purchase_rec.qty, 'ws2_' || to_char(ws2_purchase_rec.user_), 'ws2_' || to_char(ws2_purchase_rec.product));
    END LOOP;

    COMMIT;

    EXCEPTION
        WHEN OTHERS THEN
        dbms_output.put_line('An error has occurred, all work the procedure has done has been rolled backed');
        ROLLBACK TO beforeProcedure;
END;
/