Do multiple connections in application.conf mean multiple connection pool instances?

If I have multiple databases configured in application.conf like so:

db {
  default {
    ...
  }

  readreplica {
    ...
  }
}

does that mean I have two HikariCP connection pools, one for each database?

If I then have HikariCP settings defined like so:

play.db {
  # Play uses HikariCP as the default connection pool.  You can override
  # settings by changing the prototype:
  prototype {
    ...
  }
}

will these settings affect both connection pools?

1 Like

The answer to both of your questions is: yes.

You can define defaults in play.db.prototype but can still override these for each of your connections pools.
Also have a look at https://github.com/playframework/playframework/blob/master/persistence/play-jdbc/src/main/resources/reference.conf which shows you all the available config options.

1 Like