简体   繁体   中英

Handle bulk operations rollback on RESTful product

The product I have is using Spring Data REST, and wishes to follow its architecture to the teeth, but the product is required to handle updates on n resources, as a single operation by the user. In a scenario like this, we have to think, that in case we have trouble in the nth update operation, and to rollback, user would have to backup all to-be-updated data, in case of such a trouble, and update all n-1 resources back with this backup data. There is also the possibility that during rollback we might have another trouble, and whole rollback might fail, causing many problems.

How can all these be handled properly by the user without abandoning the RESTful CRUD endpoints of Spring Data REST (meaning not to create custom batch endpoints to break architecture)?

My question is to get ideas on how to safely handle above scenario as the user of an uncustomized Spring Data REST product.

我认为回答了您有关使控制器端点具有事务性的问题,但是,如果您希望任意相关的更新具有事务性,那么您并不是真正在谈论RESTful API。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM