c# - emails sent three times asp.net website -


I am working on an e-commerce website and there is one issue we are trying to solve. After completion of the customer, it is getting three emails (all the same) instead of one. The website is running on three servers and we think the problem is because only one server is used to send an email to the customer. I would like to know what we should do so that the user will receive the same email instead of three and we will still run the website on three servers. Thanks in advance, lajiyale

You can not trust the locking signal in the database for this. An indication is just an indication; There is no guarantee that locking will be as expected of you (assuming this is SQL Server). In general, there is a relational database bus, the database is a table is not a queue mechanism, and if you try to use it this way, you always have problems.

However, in order to implement a different solution, we have to determine whether a single record is being added or not "Queue" or if the three records are being added. If this is the first, and only one record is added but three emails are sent, the solution is simple. Rather than using a database table as your queue, instead of using Microsoft Messaging Quoues (MSMQ) they are a part of the Windows Server and have returned back to as little as 2003, at least until 2000. They will provide you with a real queue that you are trying to fulfill.

If the three actual records are being added to the "Queue" table in the database, which means that there is a code problem. Even with three web servers in load balancer, the fact is that single order submission is only on one of those servers business logic that keeps email notifications in the queue can not come from more than one server because the request is only a Is generated from the server.

I will first check the table and determine whether many records are being added. If not, change the implementation to use MSMQ. If so, check your code to see why more than one record is being added to the request.

Comments