Results 1 to 2 of 2

Thread: Manipulating Spring Context - 2datasources&2sessionFacto

  1. #1
    Join Date
    Aug 2005
    Location
    Madrid, Spain
    Posts
    17

    Default Manipulating Spring Context - 2datasources&2sessionFacto

    In my Spring Application Context I have 2 datasources and 2 sessionFactories. When the Applications Starts Spring cheks if the connections for both databases are OK, but I only need to check only one, is there any Interceptor to do this or Another elegant way to do this.

    Thank a lot for your help

    Hector

  2. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Spring doesn't checks the connections - the datasources and SessionFactories do. You can post pone this check by using the lazy attribute so that your beans will be initialized only when they are actually needed.
    However, if other objects depend on these one (which is usually the case) they have to be also lazy otherwise they will trigger the initialization of the whole bean tree.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

Similar Threads

  1. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  2. Spring http invoker: retrieving the application context...?
    By gvl@foundation.be in forum Remoting
    Replies: 1
    Last Post: Jun 21st, 2005, 12:59 AM
  3. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  4. Replies: 2
    Last Post: Jan 21st, 2005, 04:17 AM
  5. Beans instantiating outside spring context
    By Timm in forum Container
    Replies: 3
    Last Post: Nov 17th, 2004, 09:29 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
  •