title: Annotation equivalent of <tx:jta-transaction-manager/> for Java EE environments
body: <p>How can I achieve something similar to this:</p>
  
  <pre><code>&lt;jee:jndi-lookup id="datasSource" 
       jndi-name="jdbc/dataSourceName" expected-type="javax.sql.DataSource" /&gt;
  &lt;tx:jta-transaction-manager/&gt;
  </code></pre>
  
  <p>Using annotations?</p>
  
  <pre><code>@Configuration
  @EnableTransactionManagement
  public class AppConfig {
  
      @Bean
      public DataSource dataSource() {
        // What goes here?
      }
  
      @Bean
      public PlatformTransactionManager txManager() {
        // What goes here?
      }
  }
  </code></pre>
  
  <p>I've seen a lot of examples with <code>DataSourceTransactionManager</code> and <code>BasicDataSource</code>, but I couldn't find a equivalent annotation driven configuration (that finds the container <code>UserTransaction</code>, etc).</p>