How can I retain updates made in multiple locked rows and override scope rollback defined for row locking purposes ?

I have a set of stored procedures in SQL
One of which is called to build a list of entries to submit to a web service
Those queries are called by identical processes running on different machines, so to prevent duplicate processing we lock rows that are presently being processed.
BEGIN
TRAN TRAN1
SELECT t.[TransactionId],t.[ContentIdentifier]
FROM [dbo].[Transactions]
t WITH(READPAST,
UPDLOCK,
ROWLOCK)where
(t.Quarantined
<> 1)
COMMIT
A Second stored procedure simply updates the Quarantined flag.
My C# code
TransactionOptions transactionOptions
=
new
TransactionOptions();
transactionOptions.IsolationLevel
=
IsolationLevel.ReadCommitted;
transactionOptions.Timeout
=
new
TimeSpan(0,
10,
0);
using (TransactionScope
scopeMain =
new
TransactionScope(TransactionScopeOption.Required,
transactionOptions))
TransactionsReady = DAL.GetFilesForProcessingByServiceType(i);
using (TransactionScope
scopeSuppress =
new
TransactionScope(TransactionScopeOption.Suppress,
transactionOptions))
foreach (var
Transaction in TransactionsReady)
{ try
returnData = proxy.Submit(stuffToProcess);
using (var
scopeInner =
new System.Transactions.TransactionScope())
DAL.QuarantineTransaction(Transaction.TransactionId);
scopeInner.Complete();
scopeSuppress.Complete();
scopeMain.Complete();
The problem I experience is that if I have the Transaction Scope scopeSuppress uncommented, then the QuarantineTransaction stored procedure deadlocks.
However if I comment out the ScopeSuppress, while the process then works, if it is interrupted mid-way, then all of the Quarantine flags get reset, meaning the entire batch of items will get re-submitted next
pass (this is not desirable).
What I actually want to occur, is for the Quarantine flag to be retained on all processed records so that even if the program terminates unexpectedly, processed items remain processed but all the row locks are
released.
Does anyone know of a way to achieve this ?

The hour is late where I sit, so I don't have the time to dive into this in detail.
However, if memory serves, TransactionScopes defaults to Serializable isolation level, which may explain the deadlocks you are getting.
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • How can I have two Apple IDs (one from Canada and one from the UK) for the same device?

    I originally bought an iPhone in Canada and had my first Apple ID while there. I still want to have this account, as there are some Canadian apps that I wish to have and keep updating. However, I am now living in the UK - yet when I try to search for apps that all of my friends have I can't find them because they are particular to Britain. Do I need an new Apple ID for the UK, and is it possible to have both Apple IDs feeding into the same iTunes account?
    Thanks for any insight!

    If you want to move your iCloud account to another existing ID you'll have to delete the existing account, set up a new account with the other ID, then upload your data to the new account.  To do this, begin by going to Settings>iCloud and turn all synced data (contacts, calendars, etc.) to Off.  When prompted choose to keep the data on your phone.  After everything is turned off you can scroll to the bottom and tap Delete Account.  Then set up the new account with your other ID and turn syncing for calendars, contacts, etc. back to On.  When prompted, choose Merge.  This will upload your data to the new account.  Note: this will not migrate your photo stream photos.  You will need to save these prior to deleting the existing account.

  • How can I remove people tags from MULTIPLE images in Organizer 13?

    How can I remove people tags from MULTIPLE images in Organizer 13?  The strategy for removing keyword tags does not work. It appears that keyword tags and People tags are considered something completely different in 13.  I highlight multiple images, right click, and under keyword tags it says there are no keyword tags. There does not appear to be an option for people or other tags. Can anyone help? It is going to take literally hundreds of hours for me to do this one photo one tag at a time.  ??

    Comp. 792 wrote:
    Hi, my linked images all have dashed lines at the bottom of the images. I searched for an answer and someone said to add:
    img a {text-decoration:none:}
    to the end of my CSS,
    That CSS is complete nonsense. The correct way to remove borders from around links is here: http://forums.adobe.com/thread/417110.
    If you want to get rid of dotted lines, they are almost certainly caused by the outline property. However, outlines around links are there for a reason: it provides a visual "you are here" clue to people who navigate the web with the keyboard, either through preference or because of disability. You shouldn't remove the dotted outline without providing a different visual clue.

  • How can I point the premiere to a blank folder and bring only the files needed for the project

    When I start premiere it loads all files from all my photo/video libraries (app 150 gb almost 20,000 photo).  I do not want to sort thru all these files for a project.  How can I point premiere Elements to a blank folder and get the appropriate media for a project as I
    need them.

    As Steve points out, there are really three programs in the Premiere and Photoshop Elements "suite," PrE, PSE and then Organizer, which links between the two, and is an Asset cataloging program. Because of the commonality of the GUI (Graphic User Interface), there can be confusion as to exactly which program one is in.
    If you launch just PrE, and not Organizer (can be launched from within either PrE, or PSE), the only Assets/media that you will see is that, which you have Imported into your Project.
    Also, having the Assets for a Project, in a separate folder, or folder structure, is a great way to set up the Project. This article goes into details on one set up method: http://forums.adobe.com/message/4491450#4491450
    Good luck, and hope that helps,
    Hunt

  • My ipad is barely charging - how can i tell the difference between iphone 6 charger and ipad

    my ipad is barely charging - how can i tell the difference between iphone 6 charger and ipad

    See the following page for info on all of Apple's chargers (you'll need to scroll down a bit on that page):
    Charge the battery in your iPad - Apple Support

  • How can I retain hyperlinks while saving a webpage as PDF via Print?

    How can I retain hyperlinks while saving a webpage as PDF via Print?
    This is the title of an apple forum question, and it is a bug in both Safari 5.1.3 and under, and I find it to also occur in Firefox browser (at least 9.* 10.*, 11.0), running on Lion OS (10.7.2, 10.7.3). See:
    https://discussions.apple.com/thread/3212301?start=0&tstart=0
    Under the newer Mac OS mentioned, and Firefox 10.2, 11.0, 9.*, if I select:
    File -> Print -> PDF -> Open PDF in Preview"
    (and view / save the PDF in Preview, you will see none of the links in the original web page are active
    or using
    File -> Print -> PDF -> Save as PDF...
    same problem. Try this using any Wikipedia page, for example.
    When this problem was posed in Apple forums, by a user of the Safari browser, it was found to be a bug (since Aug 2011) fixed in a Safari browser build 5.1.4 circa Jan 2012. I tried the newer Safari browser and sure enough the problem went away (except that links embedded in the PDF no longer appeared as blue text - ARGH - but "hover over" with the cursor showed the link and clicking the link in Preview viewer activated the link in a browser window).
    So I post this to the Mozilla community, please fix this 'cause I don't want to have to switch over to Safari browser every time I want to archive a PDF with active links!!!!
    P.S. I did a spot-check and with the newer add-on Enjoy Reading 1.0.1 and FF11.0. When the Enjoy reading formatted version appears in the browser window, all URLs/links are preserved and highlighted in blue, but when I print that browser window as PDF, the links are dead (don't work) even though they appear in blue in the PDF.
    So, what's going on, can the Safari fix be researched and applied to FF?
    Also, on some forums, people are responding, Well, try installing Acrobat reader. Well, I don't want to, Preview reader has worked fine for me for years.

    Thanks jscher2000.
    RE: -- '''Generally speaking, PDF converters that work by intercepting a print job do not have access to the URLs behind links in the page.''' --
    I cannot say I agree. I could email you a PDF clipping or two (generated from Safari on Mac OS, in its native capability with no add-ons) that shows you otherwise. When I used PC platforms I did have to install PDF converters (tried both free and expensive ones) that did what I describe.
    I cannot try the add-on you mention, '''Print Pages to Pdf.''' in Firefox. It shows in my browser and Mac OS platform "Not available for your platform." So I am guessing it was written for the PC version of Firefox.
    The Mac OS has had a native PDF-creation functionality for as many years as I have been using it; I used PC prior to that, Win3.1 through XP and NT. And on my PC, I bought (and at work, my employer bought $$$, I had to justify three levels up to management the ability to create PDFs on my work PC) some Adobe functionality to CREATE pdf's (readin's free and easy, makin' em's costly on the PC).
    I've gone and dug through some of my (Mac) doc and clipping archives, and I find that stuff I created after about Dec 2008 or so seems to eliminate all link functionality. When viewed in the Apple native "Preview" application (sort of Apple's equivalent to Adobe Acrobat reader, ships with the OS): link tags are highlighted/tinted, clicking a link opens a (default) browser and takes you there; hover-over the tag text shows the actual link. (Of course, not all old links are still VALID or point to the desired source.)
    I could, in Safari or FF browser window and with no add-ons or Adobe paid products whatsoever, use the native OS method to create PDF's from any application (word processor, spreadsheet, browser, etc) via the menu File -> Print -> Save as PDF menu and create a PDF that had active hyperlinks. In Apple OS Lion 10.7.3, I still can't when it uses this broken WebKit interface, links are "dead" as a doornail until a fix is distributed in WebKit for a future Lion release. It seems this functionality died at least as far back as Leopard OS 10.6.8, but don't quote me on that. Also, my version of Pages 2009 version 4.1(923) (sorta like Word) STILL creates a PDF document that preserves (1) text hyper-links within the document, and (2) web links (in the PDF) that open the browser. I just made a test document.
    When all you can see in the PDF is the tag text, there is nothing to copy-paste to follow any link. Also, hypertext links are often used by authors to create links to other points in a document: now even *that* is broken in the PDF version of the documents I retrieve from the web and print from FireFox (Broken in Safari 5.1.3 and earlier but fixed in 5.1.4).
    Try this on the PC, in your browser and print a news clipping as PDF, do the links in the PDF work? What products do this, and what don't? I would bet the machine with a full Adobe suite this will work flawlessly. (Why should a PC user have to pay hundreds of $ to create this functionality in what I thought was an open standard (PDF)? But that's talkin' religion, let's not start that.)
    Some folks might say,
    go online and find the original source doc in your browser. Or,
    go and add those links manually using the Preview edit add-link capability (hunh? no thanks) , or
    save each item worth saving as an HTML archive instead of a PDF (argh, creating a whole directory in the process, I might add, including ads). Or,
    who needs PDFs, everything is online.
    Or, buy some Adobe product.
    I think they miss my point. This is a real strange dumbing-down of archival PDF documents, or at least a destruction of the ability to use PDF as an archive that retains its links and references.
    C.F. the guy who has archives of scientific papers, and the old material all cross-references nicely but after date X there are no working links.

  • How Can i retain the Shared Variable Values after PC rebooting

    Hi all,
    I am facing a paculiar problem with Shared Variables. I have an application in which shared variables are used for data communication.
    One of the application requirement is to retain the variable values eventhough PC is rebooted or started after crashing. 
    As per the my understanding, the variable values will retain eventhough the PC is rebooted. But here i can observe a paculiar problem like some library variables are retaing the values while some others not. I enabled logging for all the variables.
    I tried many ways. like logging enabled, logging disabled, changing variable names, changing process names etc... But i am not getting a consistent behaviour.
    I hope some you can help me in solving this issue.. "How Can i retain the Shared Variable Values after PC rebooting"
    Thanks and Regards,
    Mir

    Hi Blackperl,
    Thanks for the post and I hope your well. 
    What do you mean by not getting consistent behaviour.. this will all depend on excatly when the crash happens i.e. before the write or after. 
    Surely a better method would be to log the data to a file during the reboot...
    I beleived the value read back
    will be the default value for the shared variable's data type.
    The LabVIEW DSC 8.0 module adds more functionality to the shared variable, including initial values and alarms.
    If you enable an initial value on a shared variable, when the variable
    engine comes back on-line it will default to this value. Setting a bad
    status alarm for the shared variable is also a good way of handling
    this type of event. Additionally, if you are using a LabVIEW Real-Time
    target such as Compact RIO or Compact FieldPoint, it is appropriate to
    consider hosting the shared variable engine on the real-time target.
    These devices have watch-dog capabilities and are typically the
    hardware controlling the critical pieces of an application. Most
    Windows or PC-based targets do not have these fail-safes.
    I guess, if you could explain to me again that would be great. From my point of view, if I have a cRIO and a Windows PC. If the windows PC crashes, the cRIO will still update its shared variables. Then once the PC has started up its own shared variable engine, and the bindings are loaded, it will once again continue to update its copies of the variables.
    Please let me know what you think,
    Kind Regards,
    James.
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • I wrote an 2500 words assignment and saved in Microsoft word 97-2003 and by mistake replaced with another word file.How can i retain my original work?

    I wrote an 2500 words assignment and saved in Microsoft word 97-2003 and by mistake replaced with another word file.How can i retain my original work? 

    Hi,
    Does this happen to all 97-2003 Word files?
    Word 2013 now has lots of updates compared with earlier version of Word, lots of features have been updated. Use Word 2013 to open documents created in earlier versions of Word (Word 97-2003 format), you will probably encounter unexpected problems,
    expecially for those heavily formatted files.
    We would suggest you to convert your document to the Word 2013 file format, then you will be able to access the new and enhanced features in Word 2013.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How can i create  excel sheet with multiple tabs using utl file?

    how can i create excel sheet with multiple tabs using utl file?
    any one help me?

    Jaggy,
    I gave you the most suitable answer on your own thread yesterday
    Re: How to Generating Excel workbook with multiple worksheets

  • How can I send a message to multiple contacts using "groups".

    How can I send a message to multiple contacts using "groups".
    It was easy on my sony ericssonn....do i need to download an app?

    There is no group send option like you are looking for.
    To send to a group you have to pick each person you want to send to and send as a group that way. Then don't delete that SMS thread and you can reuse it again later.
    As for an app, well SMS works via your carrier and the OS, not something an App can do unless the app send the data to them (a third party) and then they relay it to the carrier. Do you really want to be sending your SMS to some 3rd party first?

  • How can i organize my contacts on multiple devices

    how can i organize my contacts on multiple devices

    What I ment was: How can I organize my contacts into groups without leaving the "Contacts" app.

  • HT1338 i have apps to be updated but when i try to update them a message pops out saying "You have updates for other accounts, please sigh in with the other id". Can some one help me how can i still update the same with the new apple id ive created.

    i have apps to be updated but when i try to update them a message pops out saying "You have updates for other accounts, please sigh in with the other id". Can some one help me how can i still update the same with the new apple id ive created. As i dont have the access to the earlier id anymore.

    You cannot. The apps are assigned to that Apple ID and there is nothing you can do to change that. You could choose to download them again with the new Apple ID, any paid apps will need to be purchased again.
    Hope that helps.

  • How can I remove updates from my I-pad

    How can I remove updates from my I pad

    What updates ?
    If you mean from the Updates tab in the App Store app then you can't - any updates that you've downloaded will disappear off that last in 30 days. If you don't want to install an app update then as far as I know they can't be removed from the Updates tab.
    If you want to got back to a previous version of an app then do you have a copy of that previous version anywhere ? If you do then you can delete the app from your iPad (which will also delete its content) and sync back the previous version.
    If you mean an iOS update that you've installed then you can't, downgrading the iOS version isn't supported by Apple.

  • How can I retain two versions of my iPad backup in iTunes?

    HI,
    When I backup my iPad on iTunes, the previous backup is automatically deleted and a new back is created.
    How can I retain two versions of my iPad bacup in iTunes?
    Thanks, Ramani

    Backup the device. Immediately restore the backup. The restored backup is now archived and a new rolling backup set is created. You can repeat as needed and clear older backups from Edit > Preferences > Devices.
    tt2

  • How can I forward a mail to multiple mail accounts that I have in a group without having to add them one by one?

    How can I forward a mail to multiple mail accounts that I have in a group without having to add them one by one?

    I don't think that you can. Yahoo's basic email features do not include mail forwarding.

Maybe you are looking for

  • How do I download iTunes to my dell pc?

    I am trying to download iTunes onto my Dell home pc.  Any help I can get will be greatly appreciated!  I click on "Download iTunes" and pops up a box that asks me if i want to save the file.  I click save and immediately the site says, "thank you for

  • All emails in Mail print with a light gray background.

    Since upgrading to Mountain Lion all the emails I print from Mail shows with a light gray background. How can I change that? The printouts just look dirty. Thank you!

  • Customize the text window SUBMIT ALL

    Hello everyone, I'd like to customize everything in Captivate (I live and work in Italy) In particular I would like to customize this window (I attach it) can be customized in Italian. I found a discussion here on the forum, where it says to change t

  • Why can't I find any games in the Store for Ipod Classic?

    Why can't I find any games in the Store for the Ipod Classic?

  • Can Anyone Convert this to Coding..

    Hi..new to programming. I was just asking a huge favour. Can anyone convert the following sets of instructions to code. I really am struggling in java lately...thanks if anyone has done it for me. 1. read each line from a buffered reader and create a