Results 1 to 3 of 3

Thread: Manage ApplicationContext loading beans

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Posts
    12

    Default Manage ApplicationContext loading beans

    Hello all

    Congratulation to the Spring Framework Team on a new release. Great works.

    I have 2 questions related to how Spring initializes and loads beans using an ApplicationContext class

    1. Is there a way to globally (I couldn't find it in a DTD) set lazy initialization to true for all beans in all context xml files?

    2. Is there a way to stop loading beans when a first error is encountered in context xml files? (for instance, a database is down)

    Thanks

    Regards

    Vu Le

  2. #2
    Join Date
    Aug 2004
    Location
    Southampton, UK
    Posts
    826

    Default

    Vu,

    In answer to your first question, you can set the default-lazy-init attribute of the beans tag to configure default initialization behavior. As for your second question - there is, as far as I am aware, no way to control the way Spring handles errors during bean loading - one of the other members of the team may be able to correct me here, but I haven't found any option to control this.

    Rob

  3. #3
    Join Date
    Sep 2004
    Posts
    12

    Default

    Rob

    thanks for your answer. As for my second question, it would be nice if I can register a handler to intercept when there is an error loading beans in context xml files. I think this feature is helpful to proactively handle configuration errors. In my case, if the database is down, there is no need to continue loading the rest of our components. I simply want to notify someone or take appropriate actions.

    Vu

Similar Threads

  1. Spring container fails with no exception
    By naor in forum Container
    Replies: 9
    Last Post: Oct 1st, 2005, 03:39 PM
  2. loading appcontexts while creating beans.
    By Alarmnummer in forum Container
    Replies: 0
    Last Post: Aug 22nd, 2005, 12:01 PM
  3. Replies: 4
    Last Post: Aug 17th, 2005, 04:42 AM
  4. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  5. Replies: 7
    Last Post: Oct 6th, 2004, 02:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •