
Announcements
I would like to confirm that I fully understand the option "Truncate entity data" in Data Management.
When this option is selected in the header of the Import group definition, it will call delete_from {Target entity} for every entity in the group definition lines.
I have found the code which does this job in the DMFEntityWriter::truncateEntityData(...) method
This function turns off delete validations and delete action restrictions:
targetData.skipDataSourceValidateDelete(true);
targetData.skipAosValidation(true);
targetData.checkRestrictedDeleteActions(false);
targetData.skipDatabaseLog(true);
targetData.selectForUpdate(true);
So in some cases it can leave some garbage data in DB and (hopefuly) rare occasions the user will not be able to import the data again?
What I would like to check is what really happens when delete_from {Data entity} is called. Does the kernel translates this to delete_from table (from the main data source) and the other tables are not touched, but delete actions (cascade delete) is working? Or is there something more?
Hi Sebastian,
If you enable some tracing on the development VM where you have a local SQL server, you can see what exact SQL statements will be used when it tries to delete from the {data entity}. Note that the {data entity} is a view created in the AOT and on the SQL server. Not sure what exactly will be the outcome. I can think of three scenarios (assuming it will respect the cascade delete):
1) delete from the view
2) delete from all tables used in the datasource definition
3) delete from main table and use the logic for cascade delete and the delete() method.