This weekend I had a ColdSpring singletons caching problem. Like all caching problems, sometimes they occur, sometimes they do not......pfff......very difficult to reproduce.
ColdSpring threw errors on the method addBeanToSingletonCache in abstractBeanFactory.cfc. This method tries to store a singleton object in cache and if already exists, throws an error.
I asked Luis for help on this and he came up with the following answer/solution:
It seems that ColdSpring 1.1 had errors of that sort. I would try the 1.2 nightly build. What happens is that ColdSpring caches whenever a bean says singleton=true. Now, you can go into ColdBox advanced mode and use IOCObjectCaching. This basically means that all objects produced from ColdSpring become cached in the coldbox cache. So for example, in ColdSpring you say singleton=false, so ColdSpring just produces it, then on the cfcomponent metadata, you set the cacheTimeout=0 so it becomes a singleton in the coldbox cache. Then whenever you call for it from the ioc plugin, you just get it from the ColdBox cache and not ColdSpring anymore.
Luis' solution works like a charm. All caching is done by ColdBox now!!