title: @Transaction annotation with different data sources
body: <p>We have a use-case where we want to talk to different databases which support transactions and want to do it via the annotation that spring provides.</p>
  
  <p>The way I see this annotation works is that it picks the default implementation of <code>PlatformTransactionManager</code> with the DataSource bean defined by the client and talks to that persistence layer.</p>
  
  <p>So, to talk to another data source, I will have to provide a <code>TransactionManager</code> which overrides its <code>doBegin</code> method with the help of new data source.</p>
  
  <p>But the problem here is that if I do that, there is no way for the <code>@Transaction</code> annotation to know about which data source to pick (I am not able to see how bootstrap works in these cases because I don't see a way bean conflict could arise - maybe I am missing something here).</p>
  
  <p>One alternative I can think of is to create a new annotation @DataSourceAwareTransaction which accepts a parameter for the default data source and logic gets written in the new annotation.</p>
  
  <p>The issue with this approach is that I will have to change all the existing code to move from @Transaction to @DataSourceAwareTransaction.</p>
  
  <p>The approach I am describing looks reasonable enough? Does anyone have any better ideas? </p>
  
  <p>Thanks!</p>