Results 1 to 4 of 4

Thread: InitializingBean negate lazy-init="true" ?

  1. #1

    Default 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.

  2. #2
    Join Date
    Dec 2009
    Location
    Pune,India
    Posts
    60

    Default

    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

  3. #3

    Default

    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.

  4. #4
    Join Date
    Dec 2009
    Location
    Pune,India
    Posts
    60

    Default

    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
  •