title: Spring TransactionRequiredException exception
body: <p>Here is my Repository configuration:</p>
  
  <pre><code>@Configuration
  public class RepositoryConfing {
      @Bean
      public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean(DataSource dataSource, JpaVendorAdapter jpaVendorAdapter){
          LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
          entityManagerFactoryBean.setDataSource(dataSource);
          entityManagerFactoryBean.setJpaVendorAdapter(jpaVendorAdapter);
          entityManagerFactoryBean.setPackagesToScan("com.imdb.model");
          return entityManagerFactoryBean;
      }
  
      @Bean
      public BasicDataSource dataSource(){
          BasicDataSource ds = new BasicDataSource();
          ds.setDriverClassName("org.postgresql.Driver");
          ds.setUrl("jdbc:postgresql://localhost:5432/imdb");
          ds.setUsername("***");
          ds.setPassword("***");
          ds.setInitialSize(5);
          return ds;
      }
  
      @Bean
      public JpaVendorAdapter jpaVendorAdapter(){
          HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
          adapter.setDatabase(Database.POSTGRESQL);
          adapter.setShowSql(true);
          adapter.setGenerateDdl(false);
          adapter.setDatabasePlatform("org.hibernate.dialect.PostgreSQLDialect");
          return adapter;
      }
  }
  </code></pre>
  
  <p>When I call <code>merge</code> method, I get an exception: <code>javax.persistence.TransactionRequiredException: No EntityManager with actual transaction available for current thread - cannot reliably process 'merge' call</code></p>
  
  <p>May be my <code>RepositoryConfig</code> is lacking of some additional configurations?</p>
  
  <p>EDIT:
  My new Repository configuration:</p>
  
  <pre><code>@Configuration
  @EnableTransactionManagement
  public class RepositoryConfing {
      @Bean
      public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean(DataSource dataSource, JpaVendorAdapter jpaVendorAdapter){
          LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
          entityManagerFactoryBean.setDataSource(dataSource);
          entityManagerFactoryBean.setJpaVendorAdapter(jpaVendorAdapter);
          entityManagerFactoryBean.setPackagesToScan("com.imdb.model");
          return entityManagerFactoryBean;
      }
  
      @Bean
      public BasicDataSource dataSource(){
          BasicDataSource ds = new BasicDataSource();
          ds.setDriverClassName("org.postgresql.Driver");
          ds.setUrl("jdbc:postgresql://localhost:5432/imdb");
          ds.setUsername("***");
          ds.setPassword("***");
          ds.setInitialSize(5);
          return ds;
      }
  
      @Bean
      public JpaVendorAdapter jpaVendorAdapter(){
          HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
          adapter.setDatabase(Database.POSTGRESQL);
          adapter.setShowSql(true);
          adapter.setGenerateDdl(false);
          adapter.setDatabasePlatform("org.hibernate.dialect.PostgreSQLDialect");
          return adapter;
      }
  
      @Bean
      public PlatformTransactionManager txManager() {
          return new DataSourceTransactionManager(dataSource());
      }
  }
  </code></pre>
  
  <p>Now it fails with <code>StackOverflow</code>. May be <code>DataSourceTransactionManager</code> is not suit for JPA?</p>