You must Sign In to post a response.
  • Category: .NET

    Windows service in multiple server

    I have created a windows service which is installed in '6' app server, The windows service will pick the data from db and send an email, after sending it will update the send status as '1' which will be initially '0'.

    In some cases the service is picking up the same set of data by different app server and sending email. so the same mail is sending multiple time.

    How can I fix this issue so that the server will not pick the same set of data?
  • #769716
    you have to check before proceeding to send mail that whether the data relevant column status updated to "1" or not.

    otherwise, you have to keep the update logic in a DB transaction and once the operation(update) is done then only allow the other user to update that way you can know.

    Orelse , apply row lock as exclusive during update so that other user didn't get update till first user updates.

    Thanks!
    B.Ramana Reddy


  • Sign In to post your comments