-
Feb 10th, 2011, 09:50 PM
#1
InitializingBean negate lazy-init="true" ?
Hi,
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.
Thanks.
-
Feb 11th, 2011, 03:36 AM
#2
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
#3
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
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules