§Configuring the JDBC pool.
The Play 2.0 JDBC datasource is managed by BoneCP .
Play supports special url format for both MySQL and PostgreSQL:
# To configure MySQL
# To configure PostgreSQL
In addition to the classical
password configuration properties, it also supports additional tuning parameters if you need them:
# The JDBC driver to use
# The JDBC url
# User name
# Set a connection's default autocommit setting
# Set a connection's default isolation level
# In order to reduce lock contention and thus improve performance,
# each incoming connection request picks off a connection from a
# pool that has thread-affinity.
# The higher this number, the better your performance will be for the
# case when you have plenty of short-lived threads.
# Beyond a certain threshold, maintenance of these pools will start
# to have a negative effect on performance (and only for the case
# when connections on a partition start running out).
# The number of connections to create per partition. Setting this to
# 5 with 3 partitions means you will have 15 unique connections to the
# database. Note that BoneCP will not create all these connections in
# one go but rather start off with minConnectionsPerPartition and
# gradually increase connections as required.
# The number of initial connections, per partition.
# When the available connections are about to run out, BoneCP will
# dynamically create new ones in batches. This property controls
# how many new connections to create in one go (up to a maximum of
# maxConnectionsPerPartition). Note: This is a per-partition setting.
# After attempting to acquire a connection and failing, try to
# connect this number of times before giving up.
# How long to wait before attempting to obtain a
# connection again after a failure.
# The maximum time to wait before a call
# to getConnection is timed out.
# Idle max age
# This sets the time for a connection to remain idle before sending a test query to the DB.
# This is useful to prevent a DB from timing out connections on its end.
# An initial SQL statement that is run only when
# a connection is first created.
# If enabled, log SQL statements being executed.
# The maximum connection age.
Found an error in this documentation? The source code for this page can be found here. After reading the documentation guidelines, please feel free to contribute a pull request. Have questions or advice to share? Go to our community forums to start a conversation with the community.