Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Several Orders with same ID ?


Thelostfleet

Recommended Posts

Greetings Ladies & gentlemen.

 

I'm running my site on two load-balanced servers. I've installed ssl a few weeks ago for the account and orders-processing pages (I do not know if this information is useful, but as it's the latest change I've made lately I rather mention it).

I've noticed since last week that from time to time I get two orders with the same orders_id. For example I receive an email at 23H00 for a customer A with the orders_id 10 (for example). At 00h05 (so one hour after) I receive another email for a customer B with the same orders_id 10.

On my base there is not data about the first order.

I pre-register the orders on holding_orders tables when the customers come to checkout_confirmation. On these holding_orders tables there is also not data about the first customer order.

 

Both customers paid by credit card, so their orders were inserted into the orders tables when they came back on my site on checkout_process (or more precisely with my bank, when they get back to cmcic_response).

 

As the confirmations emails are generated after the data is inserted in the tables, and as they contain the corresponding orders_id that one get after the insertion into the orders table (through a tep_db_insert_id();) I suppose the first order was inserted successfully.

However the second order (placed 1 hour after) got the very same orders_id.

 

I believe it can be related to load-balancing problems, but my hosting company does not see what can be wrong (they asked me to look for scripts errors through try and catch).

 

Has anyone encounters similar problems or has an idea about what could be causing this problem ?

 

Many thanks for your feedback.

 

 

P.S. : My site is based on a 2.3.4 version.

 

Link to comment
Share on other sites

Are these two servers using the same database server? If not, they are running as two independent sites and I would expect them to get duplicate entries like you see. If they're hitting the same database, an "autoincrement" operation should return two different values.

 

If you saw the same id value for operations on the same database, is there any chance that your host might have done a DB restore (or rollback) during that 65 minute window? Or, could something have been going on that made it look like the first operation succeeded, but in reality it didn't, and the second operation did actually succeed?

Link to comment
Share on other sites

Are these two servers using the same database server? If not, they are running as two independent sites and I would expect them to get duplicate entries like you see. If they're hitting the same database, an "autoincrement" operation should return two different values.

 

If you saw the same id value for operations on the same database, is there any chance that your host might have done a DB restore (or rollback) during that 65 minute window? Or, could something have been going on that made it look like the first operation succeeded, but in reality it didn't, and the second operation did actually succeed?

 

Hello MrPhil, thanks for your reply.

 

There was no DB restore.

 

I'm not a load-balancing specialist, but as far as I understand it : there are 2 separates servers ; each one with it's own database, but the system is designed (or should be) so that datas are replicated from one database to the other in real time, so that the two bases are always identical.

 

I'm nearly sure the problem was caused by a problem with the replication in the database, but I wanted to know if anyone had encountered similar problems with or without load-balancing.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...