Basically you can follow 2 approaches for that:
- Be sure every instance manages its own data (not sharing it with any other one).
- Be sure only one instance can access to the information every time.
The first point depends of your own business logic, for the second one there are some tools can help you, with an easy integration with Spring:
Quartz
Shedlock (easier than Quartz but with less functionality)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…