Hello IvyTeam, We are using the Ivy.repo() API for storing our data. Let's say we want to save a list of objects and if there is a problem by saving one of them, we should rollback what has been done for the previous ones. Is there a kind of transaction management with the Ivy.repo() API? Can we work like in one "transaction" for having the advantage of such a rollback function? Or should we implement it by our own, like going back to previous objects versions? Do you know how to achieve that? Thanks a lot in advance Emmanuel asked 28.05.2019 at 03:40 Emmanuel Comba |
Hi there Business data uses an optimistic locking approach: so it gives you many possibilities for save update/write/merge scenarios https://developer.axonivy.com/doc/latest/DesignerGuideHtml/ivy.datamodeling.html#ivy-businessdata-concept This is why we can provide rock solid persistence mechanisms reflected by multitudes of write methods (save, update, overwrite): https://developer.axonivy.com/doc/latest/PublicAPI/ch/ivyteam/ivy/business/data/store/BusinessDataRepository.html So I guess you are looking for the update() method which provides the richest capabilities to react on persistence failures. If you have the rollback of non-atomar write operations in mind, then it is a very different case. To support this would be a paradigm break for optimistic locking. As optimistic locking is designed to get rid of all the problems of classical tx based write scenarios. So basically if you have list of objects that belongs together for being in a consistent state, it should also be shared in the same businessData object. But maybe we clarify this better with a concrete data model. Feel free to share it :-) answered 28.05.2019 at 03:56 Reguel Werme... ♦♦ Thanks for your answer Reguel. We are exactly is this scenario: non-atomar write operations in mind. Here we would like to have the save operation of several different objects in one transaction: if one fails all the previous ones should be rolled-back automatically. This is something the application will have to take care from itself.
(28.05.2019 at 04:55)
Emmanuel Comba
|
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 28.05.2019 at 03:40
Seen: 1,731 times
Last updated: 28.05.2019 at 04:55