What is the best practice? Commit changes on an  persistent entity or not?

0
What is the best practice? Commit changes on an  persistent entity or not?   We have a wizard-page with 10 steps. Because of the file-dropper, we use a persistent entity to collect the choices. At the end we send the data to a api. We don’t keep history of so.   So we use persistent entity like a non persistent. But must we commits changes to that entity or is it not need?  
asked
2 answers
2

Normally you should not have to commit in this case, however when using the filedropper the entity gets committed automatically (see also  https://community.mendix.com/link/space/app-development/questions/142191 ).

 

In this case I would add an WizardStarted date attribute and use a daily scheduled event to delete the objects which are older than a day.

answered
2

Hi Pascal,

 

If you have any of the below requirements

  • storing the data in Mendix or
  • Resuming activity - say after 5th step user wants to save the progress and if he wants to resume in later point in time.

Yes it is definitely recommended to have commits.

 

And after all these activities, if data is not needed in Mendix, you can perform Delete object activity after your API call is made.

 

And another approach is, you can set a retention period and write a scheduler to delete the data automatically after the retention period is completed.

So all these depends on your business requirements

 

Regards,

Ajay

answered