locked
newbie Row Locks + windows service thread safety RRS feed

  • Question

  • Hi
    i am newbie to windows programming, specially windows services

    i have the following service

    goto a database table

    Get the latest records, based on a flag(say flag=freshdata) ,

    when it gets the records it changes the flag in the table(flag=old data)

    return it as a temporary in memory table.

    apply busness rules to the records.

    if the business rules fail, go ack to the table and
    reset the flag(flag - fresh data)

    how do i make this thread safe?

    i dont want some a concurrent process of one trying to get
    the data when the previous process in trying to update the
    data

    any help is appreciated, thanks

    Wednesday, June 27, 2007 12:50 PM

All replies

  • Thread locking can't solve this, you'll need an exclusive lock on the database rows.  Moved to .NET Data Access forum.
    Wednesday, June 27, 2007 1:45 PM
  • Thansk very much for the informaiton. Can you please provide me the link to the .net data access forums? I want to see if someone is posting replies to my post
    Wednesday, June 27, 2007 2:41 PM