Home  >  Q&A  >  body text

python - How to deal with the concurrency problem of multiple requests being called at the same time during auction bidding in an auction system made with java? ?

Auction system has a function of bidding price. The current situation is that multiple requests are bidding at the same time. How to deal with this concurrency problem in the background, how to roughly analyze the business logic of who succeeds and who fails in this auction, and how to deal with the problem of data modification in the database.

When it comes to concurrency issues, I am very bad at Java concurrency and have little exposure to it. If you need framework and technology, I hope you can tell me

阿神阿神2737 days ago909

reply all(1)I'll reply

  • 滿天的星座

    滿天的星座2017-05-16 13:29:48

    The auction is not a rush purchase. You only need to judge whether the current value is larger than the requested value. Use a lock mechanism to process the requests one by one. If the value is larger than the current value, the value will be rewritten and a message will be displayed successfully. If the value is smaller than the current value, a message will be displayed. There is already a higher monk, your bid is invalid

    reply
    0
  • Cancelreply