1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
…
hibernate.connection.url=jdbc:mysql://YOUR_IP:YOUR_PORT/YOUR_DBNAME?characterEncoding=YOUR_ENCODING&autoReconnect=true&useServerPrepStmts=YOUR_NEEDS
…
# Defines the query that will be executed for all connection tests,
# if the default ConnectionTester (or some other implementation of
# QueryConnectionTester, or better yet FullQueryConnectionTester) is being used.
# Defining a preferredTestQuery that will execute quickly in your database may
# dramatically speed up Connection tests. (If no preferredTestQuery is set, the
# default ConnectionTester executes a getTables() call on the Connection's
# DatabaseMetaData. Depending on your database, this may execute more slowly
# than a "normal" database query.)
# NOTE: The table against which your preferredTestQuery will be run must exist
# in the database schema prior to your initialization of your DataSource.
# If your application defines its own schema, try automaticTestTable instead.
datasource.c3p0.preferredTestQuery=select 1 from dual
# If this is a number greater than 0, c3p0 will test all idle, pooled but
# unchecked-out connections, every this number of seconds.
datasource.c3p0.idleConnectionTestPeriod=300
# If true, an operation will be performed asynchronously at every connection
# checkin to verify that the connection is valid. Use in combination with
# idleConnectionTestPeriod for quite reliable, always asynchronous Connection
# testing. Also, setting an automaticTestTable or preferredTestQuery will
# usually speed up all connection tests.
datasource.c3p0.testConnectionOnCheckin=true
# Seconds. If set, if an application checks out but then fails to check-in
# [i.e. close()] a Connection within the specified period of time, the pool
# will unceremoniously destroy() the Connection. This permits applications with
# occasional Connection leaks to survive, rather than eventually exhausting the
# Connection pool. And that's a shame. Zero means no timeout, applications are
# expected to close() their own Connections. Obviously, if a non-zero value is
# set, it should be to a value longer than any Connection should reasonably be
# checked-out. Otherwise, the pool will occasionally kill Connections in active
# use, which is bad. This is basically a bad idea, but it's a commonly
# requested feature. Fix your $%!@% applications so they don't leak Connections!
# Use this temporarily in combination with debugUnreturnedConnectionStackTraces
# to figure out where Connections are being checked-out that don't make it
# back into the pool!
datasource.c3p0.unreturnedConnectionTimeout=0
# If true, and if unreturnedConnectionTimeout is set to a positive value, then
# the pool will capture the stack trace (via an Exception) of all Connection
# checkouts, and the stack traces will be printed when unreturned checked-out
# Connections timeout. This is intended to debug applications with Connection
# leaks, that is applications that occasionally fail to return Connections,
# leading to pool growth, and eventually exhaustion (when the pool hits
# maxPoolSize with all Connections checked-out and lost). This parameter should
# only be set while debugging, as capturing the stack trace will slow down
# every Connection check-out.
datasource.c3p0.debugUnreturnedConnectionStackTraces=false
… |