我可以在 TransactionScope 中从数据库检索数据吗?
我有一个 TransactionScope,其中包含另一个 TransactionScope,它进行插入,然后我提交内部 TransactionScope。在提交外部 TransactionScope 之前,我希望能够从数据库中检索插入的数据。可以这样做吗?
视觉辅助:
TransactionScope #1
TransactionScope #2
//Insert
TransactionScope #2 -- Committed
//Can i retrieve the values of my insert from the database from here?
TransactionScope #1 -- Committed
I have a TransactionScope that houses another TransactionScope which makes an insert, then i commit the inner TransactionScope. Before i commit the outer TransactionScope, i want to be able to retrieve the data of my insert from the database. Is it possible to do that?
Visual Aid:
TransactionScope #1
TransactionScope #2
//Insert
TransactionScope #2 -- Committed
//Can i retrieve the values of my insert from the database from here?
TransactionScope #1 -- Committed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,只要您在同一事务中执行此操作,就可以执行此操作。
Yes, you can do that as long as you're doing it from within the same transaction.