79105023

Date: 2024-10-19 13:16:20
Score: 1.5
Natty:
Report link

You need to lock your method so that only 1 thread at a time can access it.

If your app runs as a single instance then you can either “synchronize” your method or use the java.concurrent library.

Otherwise you need to combine it with something like Shedlock or Quartz.

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Serkan