Avoiding a race condition

What are the best ways to avoid race conditions in jsp at the same time so as not to slow down the process. I tried isThreadSafe = FALSE synchronized (session)

however, is there any other alternative solution?

+3
source share
3 answers

A one-time access solution (for example threadSafe=false) makes requests run one at a time. And this inevitably slows down the processing of requests.

To avoid this scenario, you need to understand why you get race conditions and (re) design your architecture to avoid the problem. For instance:

  • ,

  • , SQL .

() . , .

+6

, .

, .

, .

java- jsp, bean .

, ?

+5
isThreadSafe=false

, , , . , , , .

synchronized(session)

( ).

, , , , .

+1

Source: https://habr.com/ru/post/1730506/


All Articles