title: Reactive and Non Reactive repository in a Spring Boot application with H2 database
body: <p>In addition to a non-reactive JPA repository, I introduced a reactive repository in my Spring Boot app with H2 database.</p>
  <pre><code>com.app.respository.BusinessRepository extends JpaRepository
  com.app.respository.r2dbc.PendingBusinessRepository extends ReactiveCrudRepository
  </code></pre>
  <p>And I added a connection factory for reactive H2.</p>
  <pre><code>@Configuration
  @EnableR2dbcRepositories
  public class R2DBCConfiguration extends AbstractR2dbcConfiguration {
      @Bean
      public H2ConnectionFactory connectionFactory() {
          return new H2ConnectionFactory(
                  H2ConnectionConfiguration.builder()
                          .url(&quot;jdbc:h2:file:~/data/demo-rxdb&quot;)
                          .username(&quot;sa&quot;)
                          .password(&quot;password&quot;)
                          .build());
      }
  }
  </code></pre>
  <p>After this change, my application is not able to find the non-reactive repository. It says:</p>
  <blockquote>
  <p>Field businessRepository in
  com.app.service.BusinessServiceImpl required a bean
  of type 'com.app.repository.BusinessRepository' that could not be
  found.</p>
  <p>The injection point has the following annotations:</p>
  <ul>
  <li>@org.springframework.beans.factory.annotation.Autowired(required=true)</li>
  </ul>
  <p>Action:</p>
  <p>Consider defining a bean of type
  'com.app.repository.BusinessRepository' in your configuration.</p>
  </blockquote>
  <p>I can only guess that maybe my H2 database is now reactive (non-blocking) which is not supported by a JPARepository (blocking). But is my assumption correct?</p>
  <p>I have mixed needs. I need only <code>PendingBusiness</code> table data in a non-blocking way (which is constantly being fluxed out on UI through event stream) and I need the rest of the tables' data in a traditional blocking way. Is it possible to achieve what I want through a single H2 database instance?</p>