title: Spring SingletonBeanFactoryLocator bean destruction
body: <p>While using <code>SingletonBeanFactoryLocator</code> and its <code>BeanFactoryReference</code> I found out that when I call <code>release</code> on <code>BeanFactoryReference</code> instance, some of the beans in the context are destroyed but some continue to live. My assumption was that all of them would be destroyed.</p>
  
  <p>A consequence of this is, next time I use <code>SingletonBeanFactoryLocator</code> and <code>BeanFactoryReference</code> with same keys, instead of getting brand new beans, I get some beans carried on from the previous context. I'm not able to find a pattern behind this. These beans are singletons yet some of them are created anew and some of them carry on from old context. Why is it so?</p>
  
  <p>Example:
  let's say I have beans A, B and C in my context. All are singletons, B is injected in A and C is injected in B.</p>
  
  <p>I get <code>BeanFactoryReference</code>, get these beans and then release <code>BeanFactoryReference</code>.</p>
  
  <p>I then again get <code>BeanFactoryReference</code>; beans A and B are new but C is from old context (I printed their system hash codes to check it). </p>