在多用户环境中处理数据编辑的回滚?
在多用户环境中通常如何处理数据编辑的回滚?您是否识别该事务并构建任何后续相关事务的图表,然后将它们全部回滚?大多数 RDBMS 是否提供了执行此类操作的接口或机制?
尽管我很天真,但我想过从备份中恢复,但后来我意识到这将恢复潜在的数十个用户对不相关记录所做的更改。编辑/备份时间与当前时间之间。
How to you typically handle roll backs for data edits in a multi-user environment? Do you identify the transaction and build a graph of any subsequent dependent transactions and then roll them all back ? Do most RDBMS's provide an interface or mechanism to do this sort of thing?
Naive as I am, I thought about restoring from backup, but then I realize that this would revert the changes made to unrelated records by potentially tens of users. between the time of the edit/backup and the present time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
(基于 SQL Server)
通常,如果您的编辑位于 开始事务 ... 提交TRANSACTION,这将锁定相关的表/字段等,以便其他用户无法编辑相同的数据。
您还可以回滚事务以及可以回滚的嵌套事务。
很大程度上取决于用户如何从数据库访问数据。
(Based on SQL Server)
Normally, if your edits are placed withing in a BEGIN TRANSACTION ... COMMIT TRANSACTION, this will lock the relavant tables/fields etc so that other users cannot edit the same data.
You can also ROLLBACK the transaction as well as nest transactions which can be rolledbacked.
A lot will depend how the users access the data from the database.