salvage a new object if a savepoint where it was saved to DB was aborted?
0
Hi. Mendix has means to automatically revert persistable objects to previous state in case of error, but it's only effective for changes made inside a Commit Object/Commit List activities (the new state and the members changed in BCO_/ACO_ entity events). Regular Error Handling does NOT revert objects. If an object was new, was saved to DB in a sub-microflow that has error handling and then this sub-microflow failed, then in the error flow this object's isNew() will be returning false and its members will have values set in the failed sub-microflow. The object does not exist in DB and Mendix will not be able to save this object again. The "Rollback Object" activity won't do anything because Mendix considers the object pristine. How to retry saving this object to DB? The automatic revert only affects the object you're trying to save. The referenced autocommitted objects and objects indirectly saved by a BCO_ are not reverted. That is, an autocommitted object may have isNew()=true, but the record is still missing in the DB after the savepoint rollback and the commit activity will not insert the record.