Log_events in transactions

This commit is contained in:
Jan Kvetina 2021-12-29 19:48:08 +01:00
parent 924b0c4c5d
commit d3f96fe357

View File

@ -1593,8 +1593,6 @@ CREATE OR REPLACE PACKAGE BODY app AS
) )
RETURN log_events.log_id%TYPE RETURN log_events.log_id%TYPE
AS AS
PRAGMA AUTONOMOUS_TRANSACTION;
--
rec log_events%ROWTYPE; rec log_events%ROWTYPE;
BEGIN BEGIN
rec.app_id := app.get_app_id(); rec.app_id := app.get_app_id();
@ -1638,13 +1636,11 @@ CREATE OR REPLACE PACKAGE BODY app AS
rec.event_value := in_event_value; rec.event_value := in_event_value;
rec.created_at := SYSDATE; rec.created_at := SYSDATE;
-- --
COMMIT;
INSERT INTO log_events VALUES rec; INSERT INTO log_events VALUES rec;
-- --
RETURN rec.log_id; RETURN rec.log_id;
EXCEPTION EXCEPTION
WHEN OTHERS THEN WHEN OTHERS THEN
ROLLBACK;
app.raise_error(); app.raise_error();
END; END;