The attached test case demonstrates that @Resource of injection of singleton in prototype using AnnotationConfigApplicationContext is not thread-safe. However, changing @Resource to @Autowired seems to resolve the issue.
This very much looks like a variation of #14439 and seems to be covered by that fix already. In any case, your test consistently passes for me after that fix.
Bob Tiernay opened SPR-9852 and commented
The attached test case demonstrates that
@Resource
of injection of singleton in prototype using AnnotationConfigApplicationContext is not thread-safe. However, changing@Resource
to@Autowired
seems to resolve the issue.Please see http://stackoverflow.com/questions/12700239/thread-safety-of-calling-bean-methods-from-returned-annonymous-inner-classes/12700284#comment17146235_12700284 for more details
Affects: 3.1.2
Reference URL: http://forum.springsource.org/showthread.php?130731-Thread-safety-of-calling-Bean-methods-from-returned-annonymous-inner-classes&p=426403#post426403
Issue Links:
The text was updated successfully, but these errors were encountered: