复制连接主机时的一个愚蠢的错误让我指向了一个不正确的端点......这阻止了初始化过程 30 分钟......
最后是例外:
- 采集尝试失败!!!清除挂起的获取。在尝试获取所需的新资源时,我们未能成功超过允许的最大获取尝试次数 (30)。
试图重现错误我只是用以下连接字符串指向 google.es
jdbc:mysql://google.es/myDB
正在初始化 c3p0 池... com.mchange.v2.c3p0.ComboPooledDataSource [acquireIncrement -> 1,acquireRetryAttempts -> 30,acquireRetryDelay -> 1000,autoCommitOnClose -> false,automaticTestTable -> null,breakAfterAcquireFailure -> false,checkoutTimeout -> 0 , connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hgeksr8t1vk3sn21ui8jk0|53689fd0, debugUnreturnedConnectionStackTraces -> false, 描述 -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hgeksr8t1vk3sn21ui8jk0|53689fd0, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://google.es/myDB, maxAdministrativeTaskTime -> 0,maxConnectionAge -> 0, maxIdleTime -> 3600, maxIdleTimeExcessConnections -> 300, maxPoolSize -> 5, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {user =*, 密码=* }, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false]
并且初始化在这 30 分钟内被卡住了......
我希望它更快地抛出异常,但我不确定我应该触摸哪些配置值:c3p0 acquireRetryAttempts? 还是 jdbc socketTimeout?最重要的是,如果我改变它可能会破坏什么......