Hi there!
We have an app that writes certain records into a table within a transaction.
one transaction could look like this:
begin work;
insert record1 into mytable;
insert record2 into mytable;
commit;
now i'd like to implement some code (a trigger?), which checks whether both records have been inserted and if not raises an error and/or writes an entry into some log (ascii-file) and rolls back the transaction.
the problem is, when i try to write a trigger to do the job, i cannot determine the point of time of the commit, so i won't be able to tell, whether the second record will follow the current and so cannot decide if i have an error or not. the sequence of the records must not be (1 then 2) it can also be (2 then 1).
i cannot manipulate the app which creates the records.
any ideas?
We have an app that writes certain records into a table within a transaction.
one transaction could look like this:
begin work;
insert record1 into mytable;
insert record2 into mytable;
commit;
now i'd like to implement some code (a trigger?), which checks whether both records have been inserted and if not raises an error and/or writes an entry into some log (ascii-file) and rolls back the transaction.
the problem is, when i try to write a trigger to do the job, i cannot determine the point of time of the commit, so i won't be able to tell, whether the second record will follow the current and so cannot decide if i have an error or not. the sequence of the records must not be (1 then 2) it can also be (2 then 1).
i cannot manipulate the app which creates the records.
any ideas?