Announcement Announcement Module
Collapse
No announcement yet.
Single dao to multiple data sources Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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.

      Comment

      Working...
      X