如何在C#中实现内存事务范围?
我们有一个缓存,我想在其中放置一些事务范围,以便任何进程都必须显式“提交”它想要对缓存对象执行的更改,并且可以在进程中途失败时回滚任何更改。
现在,我们正在根据 get 请求深度克隆缓存的对象,它可以工作,但它不是一个干净的解决方案,并且还涉及相当多的维护。
我记得不久前听说过 .NetRocks 上的一些 MTS(内存事务范围)解决方案,但不记得它的名称了!有谁知道有什么好的 MTS 框架吗?或者,如果我要实现自己的,是否有任何好的指南/模式来说明如何做到这一点?
谢谢,
编辑:我的缩写完全错误!应该是STM,软件事务内存
we have a cache which I would like to put some transaction scopes around so that any process have to explicitly 'commit' the changes it wants to do to the cached objects and make it possible to rollback any changes when the process fails halfway as well.
Right now, we're deep cloning the cached objects on get requests, it works but it's not a clean solution and involves a fair bit of maintenance too.
I remember hearing about some MTS (memory transaction scope) solution on .NetRocks a while back but can't remember the name of it! Does anyone know of a good MTS framework out there? Alternatively, if I was to implement my own, are there any good guidelines/patterns on how to do this?
Thanks,
EDIT : got my abbreviation completely wrong! It should have been STM, Software Transaction Memory
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您好像还记得 .NET Rocks 对软件事务内存的讨论。
不幸的是,目前还没有一个发布的、有效的、可用的框架。这仍然是 DevLabs (STM.NET) 中的一个研究项目。
此时,您的克隆选项可能仍然是最好的方法,至少对于任何非研究或商业应用而言。
It sounds like you're remembering the discussion of Software Transactional Memory from .NET Rocks.
Unfortunately, there isn't a released, working, usable framework for this (yet). This is still a research project in DevLabs (STM.NET).
At this point in time, your cloning option is probably still the best approach, at least for any non-research or commercial application.