I am using
configurableListableBeanFactory.destroyScopedBean("MyForm")
to clear the MyForm bean from the session(it’s a session scope spring bean).
After destroying the bean in the very next line I did,
MyForm myForm= (MyForm)configurableListableBeanFactory.getBean("MyForm");
I was expecting the myForm instance to be null but it’s not instead it’s still an object but all the instance members of MyForm are now null!
shouldn’t the myForm object been completely removed from the session(thus becoming available for GC) instead of it’s instance member’s values changed to null?
Thanks
The answer for my query is that,
is built on top of
, Once I have destroyed the scoped bean, and then I again query for that bean, so I am returned a new bean instance! 🙂