Hi Arpan,
It looks like your database is aborting the transaction when it detects the
deadlock. Setting DisableCommit will not help. You need to bubble up the
error outside the layer that started the transaction. You can't do any
database work as part of this doomed transaction.
Regards,
--
Florin Lazar - Microsoft - [
http://blogs.msdn.com/florinlazar ]
Please do not send email directly to this alias. This alias is for newsgroup
purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view] "Arpan Patel via .NET 247" <anonymous@dotnet247.com> wrote in message
news:OpcxQdROEHA.308@TK2MSFTNGP11.phx.gbl...
Hi all,
I am having a problem figuring out error handling with my serviced
component. I am reading data from the database and I get deadlock errors.
To solve deadlock, i catch that error and resubmit it and i get following
error: "Distributed transaction completed. Either enlist this session in a
new transaction or the NULL transaction." Any idea what i can do here? it
seems like that the transaction is setting to complete. I have added code
to disable setcomplete but it still doesnt work. Here is the psuedo code
for what i am doing:
private sub GetData(...)
Try
GetDatafromDb()
Catch ex
if error = deadlock then
ContextUtil.DisableCommit()
GetData (resubmit)
else
throw ex
End If
End Try
End sub
Please let me know what I am doing wrong. Thank you.
--------------------------------
From: Arpan Patel
-----------------------
Posted by a user from .NET 247 (
http://www.dotnet247.com/)
<Id>DWXCSg+RWEyWOU0Cpd/rpg==</Id>