title: How can you use a Spring DataSourceInitializer with both a @Primary and secondary DataSource bean?
body: <p>I have a scenario where I'd like to have a <code>@Primary DataSource</code> bean that depends on another <code>DataSource</code> bean. I am currently encountering a <code>BeanCurrentlyInCreationException</code> exception when I do this because the <code>DataSourceInitializer</code> triggers resolution of the <code>@Primary</code> bean while it is still being created.</p>
  
  <p>I've created an example repository that reproduces this issue and explains it in more detail, if helpful: <a href="https://github.com/zachmarshall/spring-datasource-init-bug" rel="nofollow noreferrer">https://github.com/zachmarshall/spring-datasource-init-bug</a></p>