Feb 10th, 2011, 09:50 PM
InitializingBean negate lazy-init="true" ?
I've noticed that a bean configured with lazy-init="true" is always being loaded, even if it's not referenced by any other bean.
The bean in question extends SqlMapClientDaoSupport which implements InitializingBean...is the fact that it implements this interface causing it to ignore the lazy initialization?
Is there any other way around this? We have properties that determine what beans to load. Loading this bean typically causes errors so at the moment we are just removing it from the configuration, which is not very seamless.
Feb 11th, 2011, 03:36 AM
You must have been injected your lazy bean into a bean which is not lazy load ie. lazy-init="false" ( which is default ) that might causeing negation of lazy-init.
InitializingBean will not cause negate of lazy init
Feb 11th, 2011, 08:19 AM
I haven't. If this was the case then when I remove the lazy bean I'd receive an error based on any other dependencies.
At the moment when I remove the lazy bean no errors are thrown.
Feb 13th, 2011, 09:10 PM
In my case it is working just fine . I am using Spring 2.5.6
Can you please put your context file configurations and your java file code