Example: If we are inserting 10 records in an object, Where 5 records are correct and the remaining 5 records are incorrect. • In Database.insert 5 records will be inserted, remaining 5 records will be failed.(i.e. Partial DML Operation). (record.addError is in after insert trigger.) (no workflows, flows, or process builder on that object or validation rules)
Assumption: database.insert goes first time through trigger and in the end of after insert trigger we can do soql and see 10 records ids and etc.(they are not committed yet) then before commit to DB occurs error and system starts again insertion(now only of the correct records) and in trigger goes these 5 correct records(so it goes to trigger the second time) and process continues till the end.
Question: tell me please is that correct? (before answer check please :) ).