Current location - Education and Training Encyclopedia - Graduation thesis - Asp.net's graduation thesis.
Asp.net's graduation thesis.
First, create a new HashMap in the init () method when the website starts, and then store the existing order number in the HashMap from the database, because the init () method will only be called when the website starts for the first time. Put this HashMap in ServletContext, which is the memory space available to all users in the website, and ASP.NET should also have it. Then, every time a user enters a website to buy a product and generates an order, the order number is generated by random numbers, and then it is seen whether this KEY key is included in HashMAP. If so, the random number will be regenerated. Finally, the order number in HashMap is stored in the database in the destroy () method of the website. This only needs to call the database twice, which is faster.