r2dbc / r2dbc-pool

Connection Pooling for Reactive Relational Database Connectivity
https://r2dbc.io
Apache License 2.0
332 stars 55 forks source link

H2 Pooling configuration #133

Closed cemo closed 3 years ago

cemo commented 3 years ago

Bug Report

This is the relevant section of my configuration to create h2 pool for testing. It is working against PostgreSQL but not for H2. H2 requires mem or file settings by protocol but setting it overriding options.

r2dbc:
  datasources:
    default:
      options:
        driver: pool
        protocol: h2
      url: r2dbc:h2:mem:///testdb-r2dbc=-1
      username: sa
      password: ''
      dialect: h2

Versions

Steps to reproduce

I tried like this too but I could not figure out it too.

        ConnectionFactories.get(ConnectionFactoryOptions.builder()
                                                        .option(DRIVER, "pool")
                                                        .option(PROTOCOL, "h2")
                                                        .option(HOST, "")
                                                        .option(USER, "sa")
                                                        .option(PASSWORD, "")
                                                        .option(DATABASE, "Testmem")
                                                        .build());
mp911de commented 3 years ago

Please use h2:mem as protocol.