Home > Back-end >  Java background insert two data at the same time
Java background insert two data at the same time

Time:05-01

Who met and insert the two data creation time is the same is carried out twice to give some ideas
Do not know how to start and random

CodePudding user response:

Then insert two ah, big deal first time to get out and then the two data in one time, this time is the same

CodePudding user response:

Is it will be now?

CodePudding user response:

refer to the second floor zc881124 response:
will now?



Until now doubt is caused by the cache
Beginners really can't find the reason
At the same time insert two identical data (in addition to the primary key ID), creation time accurate minutes then,
For such a problem really don't know

CodePudding user response:

reference 1st floor u010223407 response:
then insert two ah, big deal first time to get out and then the two data in one time, this time the same



Until now doubt is caused by the cache
At the same time insert two identical data (in addition to the primary key ID), creation time accurate minutes then,

CodePudding user response:

You said random is that sometimes two, sometimes is a? What do you use? Hibernate? What is primary key generation strategy?

CodePudding user response:

reference qq_32669651 reply: 3/f
Quote: refer to the second floor zc881124 response:

Is it will be now?



Until now doubt is caused by the cache
Beginners really can't find the reason
At the same time insert two identical data (in addition to the primary key ID), creation time accurate minutes then,
For such a problem really don't know



Why a cache is suspected, I understand it, the cache generally will not lead to insert two,
Advice posted on the inserted code,

CodePudding user response:

You can check at the front

CodePudding user response:

Insert the two, two is operating in the database, the cache can do not have the right of operation database, check code, said the project technology, by the way, or guess guess

CodePudding user response:

Starting from the request to check up, ruled out two request first, step by step, look up,

CodePudding user response:

Marking,,,

CodePudding user response:

The building Lord find the problem? I also met the same situation [face] monkey2:001 PNG [/face]

CodePudding user response:

The repeat submit? Some pages do not rigorous, click on the submit button, the browser attached to refresh it twice, you can repeat submit twice,
Accurate to seconds is also unable to pinpoint problems, generally speaking, the database can be inserted into more than two thousand records of one millisecond, server performance good, will be more,
One second, artificial manually refresh the web page twice time is enough,

To eliminate the problem on the program logic, and then screening, whether repeat submitted the form,
  • Related