Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Jul 26, 2022
    • dpsutton's avatar
      Set a timeout for `isValidTimeout` (#24289) · 991a9bc5
      dpsutton authored
      * Set a timeout for `isValidTimeout`
      
      When using ssh with db connections:
      Our theory is that the db connection has no idea that it sits on top of
      an ssh connection. And if the ssh connection dies (ie, `show full
      processlist` and then `kill <id>` from that list in mysql) the db
      connection has no idea it is dead. "It" is valid but its ssh transport
      is dead.
      
      > It is possible to customize how c3p0's DefaultConnectionTester tests
      > when no preferredTestQuery or automaticTestTable are available. Please
      > see Configuring DefaultConnectionTester.isValidTimeout and Configuring
      > DefaultConnectionTester.QuerylessTestRunner.
      
      from https://www.mchange.com/projects/c3p0/#automaticTestTable
      
      > Configuring DefaultConnectionTester.isValidTimeout
      
      > Under circumstances when the JDBC 4+ isValid(...) test will be used by
      > c3p0's built in DefaultConnectionTester (see below), by default the test
      > will never time out. If you would the test to timeout and fail, set the
      > following key
      
      >    com.mchange.v2.c3p0.impl.DefaultConnectionTester.isValidTimeout
      
      > to the desired timeout, in seconds.
      
      https://www.mchange.com/projects/c3p0/#configuring_dctivt
      
      * Bump to 6 seconds. Worried 3 might be a bit too quick
      Unverified
      991a9bc5
  2. Apr 16, 2019
    • Andrew Stiegmann (stieg)'s avatar
      Migrate C3P0 config settings to c3p0.properties file · 60544112
      Andrew Stiegmann (stieg) authored
      As per configuration_precedence document noted in the c3p0 config doc
      (https://www.mchange.com/projects/c3p0/#configuration_precedence) any
      setting which is specified programatically may not be overridden by
      other external settings such as system properties.  This creates an
      issue if an admin wishes to set any of these settings.
      
      In my case I was attempting to have c3p0 shut down all connections
      to my RDS instance so that amazon would spin the instance down while
      not in use.  Alas it appears that something else seems to re-establish
      connectinons every few seconds and prevent my desired behavior. But
      before I abondon this approach I figured this would be a good PR
      for the project as it will enable others to set this settings as they
      see fit and not hit the same roadblocks I hit along the way.
      
      Of note I have removed the maxPoolSize setting as the current value
      of 15 is the same as the driver default. The other settings remain.
      60544112
  3. Oct 14, 2016
  4. Jun 09, 2015
  5. Mar 06, 2015
  6. Feb 04, 2015
Loading