Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7819203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:50:56+00:00 2026-06-02T06:50:56+00:00

i am trying to create a ecommerce website for my school project,but i am

  • 0

i am trying to create a ecommerce website for my school project,but i am confused about when to update the quantities in the database.When i am going to add the product to cart or when i complete the order?If i decrease the quantity when i add the product in the cart and the customer doesn’t complete the order then i must increase the quantity again.So the only way is to update the quantity when a customer completes the order,and if 2 customers go to the final page together then to put an if statement to check the quantity in order to finalize the order,and if one of the 2 customers took the last product then the other will get a message like”We are verry sorry,the last product sold 2 minutes before”.
Is this the right way of thinking?Any other idea?(Sorry for my english.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:50:56+00:00Added an answer on June 2, 2026 at 6:50 am

    This is whats called a race condition.

    In a situation like this you will need to update the stock for the first customer to complete their transaction in a transaction and notify the other customer that the stock is gone , or use your first idea and decrement the stock but if the customer cancels reincrement. Either should work with planning.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to create Database as follows: USE Master GO IF NOT EXISTS(SELECT [Name] FROM
I'm trying create a RCP Application with Eclipse, but I can't get past the
I'm trying create a new file with a Java Applet, but I don't know
I'm trying to do a ecommerce like solution. When a product is defined, there
I am trying create a table and add this table into tablecell (table inside
I am trying create alert dailog using glade,but its not working .am i doing
Trying to create an array of structs (new to C), but I am getting
I am trying create a new css for shaping my detailsview. But i couldn't
I'm trying to implement a behavioral analysis for targeted marketing on my ecommerce website.
I am trying create my custom Style spinner with help of this site. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.