Description
Describe the bug
From time to time (in fact every day) I get the following error when using the realtime reporter:
SEVERE: Error while producing events for reporter id 22d0dc6682024054a75f3b9aca8b3738: PreparedStatementCallback; SQL [DECLARE
l_reporter ut_realtime_reporter := ut_realtime_reporter();
BEGIN
l_reporter.set_reporter_id(?);
l_reporter.output_buffer.init();
sys.dbms_output.enable(NULL);
ut_runner.run(
a_paths => ut_varchar2_list(
':a'
),
a_reporters => ut_reporters(l_reporter)
);
sys.dbms_output.disable;
END;
]; ORA-02292: integrity constraint (UT3_LATEST_RELEASE.UT_OUTPUT_BUFFER_FK1) violated - child record found
ORA-06512: at "UT3_LATEST_RELEASE.UT_OUTPUT_CLOB_TABLE_BUFFER", line 209
ORA-06512: at "UT3_LATEST_RELEASE.UT_OUTPUT_CLOB_TABLE_BUFFER", line 25
ORA-06512: at "UT3_LATEST_RELEASE.UT_REALTIME_REPORTER", line 23
ORA-06512: at line 2
The code fails while executing cleanup_buffer
of ut_output_clob_table_buffer
The reason is that the table ut_output_buffer_info_tmp
has two children with enabled foreign key constraints:
ut_output_clob_buffer_tmp
ut_output_buffer_tmp
But only the first one is deleted in this procedure. Hence we get a ORA-02292: integrity constraint (UT3_LATEST_RELEASE.UT_OUTPUT_BUFFER_FK1) violated - child record found
.
Provide version info
19.0.0.0.0
19.0.0
PL/SQL procedure successfully completed.
UT_VERSION
------------------------------------------------------------
v3.1.7.2980-develop
BANNER BANNER_FULL BANNER_LEGACY CON_ID
-------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ----------
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production 0
Version 19.2.0.0.0
PARAMETER VALUE
------------------------------ ----------------------------------------------------------------
NLS_LANGUAGE ENGLISH
NLS_TERRITORY SWITZERLAND
NLS_CURRENCY SFr.
NLS_ISO_CURRENCY SWITZERLAND
NLS_NUMERIC_CHARACTERS .'
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD.MM.YYYY HH24:MI:SS
NLS_DATE_LANGUAGE ENGLISH
NLS_SORT BINARY
NLS_TIME_FORMAT HH24:MI:SSXFF
NLS_TIMESTAMP_FORMAT DD.MM.RR HH24:MI:SSXFF
PARAMETER VALUE
------------------------------ ----------------------------------------------------------------
NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR
NLS_TIMESTAMP_TZ_FORMAT DD.MM.RR HH24:MI:SSXFF TZR
NLS_DUAL_CURRENCY SF
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
17 rows selected.
PORT_STRING
------------------------------------------------------------
x86_64/Linux 2.4.xx
Information about client software
irrelevant.
To Reproduce
- run a test using the documentation reporter
- wait until the retention time is reached
- run a test using the real time reporter
Expected behavior
An ORA-02292
must not never occur when running cleanup_buffer
.
Solution approach
- Move the the code in the member procedure
cleanup_buffer
to a centalized place (package or parent type) - Extend the
cleanup_buffer
code to handle all child tables - Remove the member procedure
cleanup_buffer
fromut_output_clob_table_buffer
andut_output_table_buffer
- Make sure that the
cleanup_buffer
code is called during construction of typesut_output_clob_table_buffer
andut_output_table_buffer
Workaround
Run the following:
delete from ut3_latest_release.ut_output_buffer_tmp;
delete from ut3_latest_release.ut_output_clob_buffer_tmp;
delete from ut3_latest_release.ut_output_buffer_info_tmp;
commit;