Singleton in Spring
Today I found an error in my project related to the singleton in Spring.
A class Pager is a Spring bean injected to a controller by IoC container.
In one method of the controller, it use Pager.data variable to store submissions from a form.
If two threads send the request at the same time, then Pager.data was written twice. So potentially the controller will return wrong result for one form.
Hongfeng Sun
Add a comment
You are not allowed to comment on this entry as it has restricted commenting permissions.