In ZF2, I have a mapper that saves data into 3 tables. Table 1 has only id
s, tables 2 and 3 have the id
s and more data. The tables are filled in turn: first table 1, then table 2, then table 3.
Suppose there is something that prevents saving to the 3rd table (failure of unique constraint, for example). Because the tables are filled in turn, the tables 1 and 2 are filled, but the 3rd isn't. So I'm left with the unused data in tables 1 and 2.
How to get rid of the values created in the tables 1 and 2 if there was a database error, and display the error message in the 3rd table?