How does the server respond to requests?

my younger brother has been changing the back-end project recently, but I can"t solve it with a bug. I think my back-end knowledge is too lacking, so I"ve come here to ask for advice.

the process is like this: the front end has uploaded information, and after the interface receives the message, it uses some of the received information to request information from the third-party interface, and stores the two parts together. Part of the message received by
is the user ID (never repeated). I use this ID + to md5, the moment the message is received (accurate to seconds) to generate a unique sequence number as the primary key.

but sometimes the upload fails, and the log is recorded in this way

Could not execute JDBC batch update. Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (SIT_QDYY.SYS_C0010324) violated

I looked at the log and found that there are two identical pieces of information, according to the method I mentioned above to generate the serial number, which is bound to be repeated. I confirmed with the front end that it would not be uploaded twice a second, so I wondered if the network request after I received the message was time-consuming (I can"t think of any other reason).

moreover, each uploaded message is not processed sequentially. For example, the interface receives the A message, and then parses and prints the log. Before it is saved, the log of the B message is recorded, and then the An information is used to request the third party interface, storage, etc.

my guess:
the server is multithreaded and processes requests all the time, but it is time-consuming to use the data requested by A to request a third-party interface, so when the request B arrives, it will process B and send another thread to the third-party interface to get A-related data (it"s all speculation here, and it"s not clear what it has to do with my bug).

The

project is deployed on Weblogic using Struts2 + Hibernate + Oracle,.


js is single-threaded, but requests can be sent continuously, and various network delays may cause simultaneous arrival. In addition, your server may also put tasks in the queue, taking a few at a time to deal with
and adding a random number


put the read and write there in the transaction and lock the table, killing the only key in the database

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8bf52-46e6e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8bf52-46e6e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?