MSDTC和交易中止 [英] MSDTC and transactions aborting

查看:80
本文介绍了MSDTC和交易中止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们遇到一些问题,一段时间后流产中止,但不仅仅是最新的更新,而是一个很长的清单

$ b已经保存的$ b对象从数据库中消失。

Hi
We're having a problem with some transactions beeing aborted after a while, but not just the latest update but a long list
of objects that was already saved disappears from the database.

我们正在使用一个带有datportal的web服务器和一个带有这些事务之间的事务的dbserver。客户端计算机使用更新来调用Web服务器。


使用自动填充创建交易。似乎更新被捆绑到一个更大的交易中,当某些事情失败了很多数据时,
¥
被回滚。

We are using a webserver with a datportal on and a dbserver with transactions beetween those. The client machines call the webserver with updates.
The transactions is created with autocomplete. It seems the updates are bundled togheter into a bigger transaction and when something fails alot of data
is rollbacked.

< Transaction(TransactionOption。 RequiresNew,Isolation:= TransactionIsolationLevel.RepeatableRead),EventTrackingEnabled(True)> _
$
公共类数据删除

<Transaction(TransactionOption.RequiresNew, Isolation:=TransactionIsolationLevel.RepeatableRead), EventTrackingEnabled(True)> _
Public Class dataportal

    '''< summary>

    '''在
   中调用服务器端DataPortal更新方法'''COM +交易。

    '''< / summary>

    <自动完成(真)> _
$
   公共函数更新(ByVal criteria As Object,ByVal principal As Object)As Object

        Dim portal As DataPortal = Server.DataPortal.GetDataPortal()

       返回portal.Update(标准,校长)

   结束函数

    ''' <summary>
    ''' Invokes the server-side DataPortal Update method within
    ''' a COM+ transaction.
    ''' </summary>
    <AutoComplete(True)> _
    Public Function Update(ByVal criteria As Object, ByVal principal As Object) As Object
        Dim portal As DataPortal = Server.DataPortal.GetDataPortal()
        Return portal.Update(criteria, principal)
    End Function



在某些情况下,我们需要为列表中的每个对象传输大量具有


In some cases we need to transfer alot of objects with

的对象

   object.Update(标准,委托人)

   ... ...
结束

for each object in list
   object.Update(criteria,principal)
   ...
end for

大部分时间这都很有效但正如我所说,有时列表中的所有更新都会回滚。问题不在于交易中止了,但由于很多似乎运行正常的更新后来又回滚了,因此问题变得很小。

Most of the time this works great but as I said sometimes all updates made in the list is rolled back. The problem isn't that the transaction is aborted,
but since alot of updates that seems to run fine is later rolled back it becomes alittle problematic.

之后这个我们也在更新其他对象时开始得到以下错误。
$
"消息:您对COM +组件进行了方法调用,该组件的事务已经中止或正在中止。


(来自HRESULT的异常:0x8004E003)"。

After this we also start getting the error below when updating other objects.
"MESSAGE: You made a method call on a COM+ component that has a transaction that has already aborted or in the process of aborting.
(Exception from HRESULT: 0x8004E003)".

捆绑的交易是否也包含在更大的交易中?

这是结束/提交每笔交易(更新)的方法吗?以便每次更新在下次启动之前提交?

So is the transactions bundled togheter into larger transactions?
Is it a way to end/commit every transaction (update)? so that every update is commited before next starts?

推荐答案

dataportal是否继承自ServicedComponent? 看起来这个代码看起来确实有效,但尝试的一个建议是在调用Update之后但在返回AutoComplete函数之前显式调用ContextUtil.SetComplete。

Does dataportal inherit from ServicedComponent?  It does look like this code should be working, but one recommendation to try is to explicitly call ContextUtil.SetComplete after calling Update but before returning within the your AutoComplete function.


这篇关于MSDTC和交易中止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆