Home > Back-end >  Submit Java interfaces in the same order 2 times, how to judge
Submit Java interfaces in the same order 2 times, how to judge

Time:09-22

If is large in the interval of time and then we can search the database, to determine whether there is the same order number, the same IP, same payment information and so on to judge;
Two consecutive request but if it is almost the same time, it can't do the judging through checking library;
Is there any solution

CodePudding user response:

If this is the demo can use Java pass limit maximum access restrictions of the same order number, if it is a cluster or distributed can take advantage of the distributed lock,

CodePudding user response:

reference 1st floor qq_36111431 response:
if it is the demo can use Java pass limit maximum access restrictions of the same order number, or if it is cluster distributed can take advantage of the distributed lock,

Java card limit what meaning is the same order number under the specific said

CodePudding user response:

Baidu search Semaphore

CodePudding user response:

Is not high safety coefficient can directly add repeat submit restrictions in js

CodePudding user response:

reference 4 floor nayi_224 response:
is not high safety coefficient can be directly added in js submitted limit

Others call our interface, js is page to write each other

CodePudding user response:

reference 5 floor like a dog. The man. Response:
Quote: refer to 4th floor nayi_224 response:

Is not high safety coefficient can be directly added in js submitted limited

Others call our interface, js is also the other pages written


Think of some way to push the responsibility in the past, js, less than a minute change is finished,

On the Java side changes is troublesome, 3 # which is essentially a single thread, the efficiency problem to deal with trouble,
If you insert operations, the most simple and direct database and the only constraint,

CodePudding user response:

refer to 6th floor nayi_224 response:
Quote: refer to 5 floor like a dog. The man. Response:

Quote: refer to 4th floor nayi_224 response:

Is not high safety coefficient can be directly added in js submitted limited

Others call our interface, js is also the other pages written


Think of some way to push the responsibility in the past, js, less than a minute change is finished,

On the Java side changes is troublesome, 3 # which is essentially a single thread, the efficiency problem to deal with trouble,
If you insert operations, the most simple and direct database to add unique constraint,

I use this interface is provided to others, can't call every customer with interface go out js

CodePudding user response:

For the moment for our system design, external system will be the only running water, is currently the only running water to determine whether the same order

CodePudding user response:

refer to the eighth floor romantic small and response:
for now for our system design, external system will be the only running water, is currently the only running water to determine whether the same orders

If the interval time is long, I can check the database to judge whether to have the same order number, if the same request 2 pen is the same time, also didn't put in storage, how do you know that is the only order

CodePudding user response:

references 9 floor like a dog. The man. Response:
Quote: refer to the eighth floor romantic small and response:

For now for our system design, external system will be the only running water, is currently the only running water to determine whether the same orders

If the interval time is long, I can check the database to judge whether to have the same order number, if the same request 2 pen is the same time, also didn't put in storage, how do you know that is the only order
interface directly with concurrent is already or synchronized, cluster with redis for distributed lock

CodePudding user response:

Is mostly about database

What judgment is the same order? Should be order serial number or similar, this field in a database table, have uniqueness constraints, the second can't write into the database
  • Related