Results 1 to 3 of 3

Thread: Single dao to multiple data sources

  1. #1
    Join Date
    May 2005
    Location
    Barcelona, Spain
    Posts
    6

    Default Single dao to multiple data sources

    Hi all.

    There is a data access interface for retrieval of read only static data. This interface is implemented by a JdbcDaoSupport which uses a regular DataSource. Should this DataSource fall an alternative DataSource should be used (a list of alternatives data sources actually).

    I can think a solution: the creation of another implementation of the data access interface which has the main JdbcDaoSupport instance and a list of alternative instances. But I'm thinking that this might be addressed using AOP. I don't know how.

    Does anybody know what the best approach to this situation is?

    Many thanks and regards,
    Rafa

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

    Default

    Rafa,

    You can create an AOP proxy that implements the DataSource interface and add an advisor that will attempt a set of actual DataSources if one should fail.

    Rob
    Rob Harrop
    Lead Engineer, dm Server
    SpringSource
    http://www.springsource.com

    Co-Author - Pro Spring

  3. #3
    Join Date
    May 2005
    Location
    Barcelona, Spain
    Posts
    6

    Default

    That is definitely a better approach. I've created the AOP proxy at the data access level though.

    Thanks indeed. Keep up your good work.

Similar Threads

  1. Replies: 3
    Last Post: Dec 27th, 2009, 10:11 PM
  2. Multiple Data Sources
    By UserStephen in forum Data
    Replies: 1
    Last Post: Jul 21st, 2005, 04:58 PM
  3. Multiple Data Sources + Hibernate + Spring
    By joeserel in forum Data
    Replies: 2
    Last Post: May 18th, 2005, 09:22 AM
  4. Multiple data sources in Spring
    By Yeshaswi in forum Data
    Replies: 1
    Last Post: May 4th, 2005, 04:34 AM
  5. Replies: 3
    Last Post: Apr 21st, 2005, 03:19 PM

Posting Permissions

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