c3p0出现了一场,每次都这样

五月 11, 2017 4:36:34 下午 com.mchange.v2.log.MLog
INFO: MLog clients using java 1.4+ standard logging.
五月 11, 2017 4:36:34 下午 com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
五月 11, 2017 4:36:34 下午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 2rxmcq9n1wfqr40a71csj|c12241e, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 2rxmcq9n1wfqr40a71csj|c12241e, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql:///day19_1, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]

2个回答

是数据库连不上吗? 数据库服务端开没开? 日志没看到异常啊

qq_32269293
爪哇岛卖咖啡 谢答,已经找到原因了,是我的吃c3p0-config.xml配置文件写错了,<property name="driverClass">com.mysql.jdbc.Driver</property>,中的driverClass写成JdbcClass了
大约 3 年之前 回复

把mysql 服务打开

qq_32269293
爪哇岛卖咖啡 谢答,已经找到原因了,是我的吃c3p0-config.xml配置文件写错了,<property name="driverClass">com.mysql.jdbc.Driver</property>,中的driverClass写成JdbcClass了
大约 3 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
tomcat启动c3p0出现如下代码,项目不能启动

2016-3-29 20:31:28 com.mchange.v2.c3p0.C3P0Registry banner 信息: Initializing c3p0-0.9.1 [built 16-January-2007 14:46:42; debug? true; trace: 10] 2016-3-29 20:31:30 org.springframework.orm.hibernate3.LocalSessionFactoryBean buildSessionFactory 信息: Building new Hibernate SessionFactory 2016-3-29 20:31:30 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager 信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 5000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge1609f1hxdqjpv398fw|5106def2, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge1609f1hxdqjpv398fw|5106def2, idleConnectionTestPeriod -> 0, initialPoolSize -> 10, jdbcUrl -> jdbc:oracle:thin:@localhost:1521:orcl, lastAcquisitionFailureDefaultUser -> null, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 50, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ] 2016-3-29 20:31:31 org.springframework.orm.hibernate3.HibernateTransactionManager afterPropertiesSet 信息: Using DataSource [com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 5000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge1609f1hxdqjpv398fw|5106def2, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge1609f1hxdqjpv398fw|5106def2, idleConnectionTestPeriod -> 0, initialPoolSize -> 10, jdbcUrl -> jdbc:oracle:thin:@localhost:1521:orcl, lastAcquisitionFailureDefaultUser -> null, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 50, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]] of Hibernate SessionFactory for HibernateTransactionManager 2016-3-29 20:31:31 org.springframework.web.context.ContextLoader initWebApplicationContext 信息: Root WebApplicationContext: initialization completed in 4030 ms 求大神来解决这个问题!

Hibernate配置C3P0连接池报错

Hibernate+MySQL部署出现了java.net.SocketException: Broken pipe (Write failed)这个错误,查百度说是因为MySQL默认连接8小时的问题,所以想采用C3P0,附上Hibernate.xml配置如下: ``` <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <!-- Generated by MyEclipse Hibernate Tools. --> <hibernate-configuration> <session-factory> <property name="myeclipse.connection.profile">sces</property> <property name="connection.url"><![CDATA[jdbc:mysql://localhost:3306/sces?useUnicode=true&characterEncoding=UTF-8]]></property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="dialect"> org.hibernate.dialect.MySQLDialect </property> <property name="connection.password">123456</property> <property name="connection.username">root</property> <!--c3p0设置--> <!--<property name="connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property>--> <!--<property name="hibernate.c3p0.min_size">5</property>--> <!--<property name="hibernate.c3p0.max_size">20</property>--> <!--<property name="hibernate.c3p0.max_statements">100</property>--> <!--<property name="hibernate.c3p0.timeout">3600</property>--> <!--<property name="hibernate.c3p0.idle_test_period">120</property>--> <!--<property name="hibernate.c3p0.acquire_increment">2</property>--> <mapping resource="entity/DCharacteristic.hbm.xml" /> <mapping resource="entity/DIops.hbm.xml" /> <mapping resource="entity/DPool.hbm.xml" /> <mapping resource="entity/DStatus.hbm.xml" /> <mapping resource="entity/Device.hbm.xml" /> <mapping resource="entity/User.hbm.xml" /> <mapping resource="entity/DDl.hbm.xml" /> <mapping resource="entity/Systeminfo.hbm.xml" /> <mapping resource="entity/DCapacity.hbm.xml"/> <mapping resource="entity/DErrlog.hbm.xml"/> <mapping resource="entity/DRack.hbm.xml"/> </session-factory> </hibernate-configuration> ``` 中间注释掉的为c3p0的部分,现在这种情况下能正常运行,但是打开c3p0后会报错: ``` 十二月 26, 2017 3:02:49 下午 com.mchange.v2.resourcepool.BasicResourcePool 警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@58f663e4 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getDriver(DriverManager.java:278) at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:285) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1138) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1125) at com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1870) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) ``` 看起来是找不到驱动,但是明明不开连接池的时候能正常跑的,说明驱动没问题呀,为什么会这样呢 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 补充:直接在IDE中运行读取数据库的操作可以正常运行,但是把程序放到tomcat中就会 报这个错误,MySQL的驱动在tomcat的bin和lib中都放了,求解!!!!!

c3p0连接mysql报错,c3p0配置都没问题

连不上数据库,这是什么问题?c3p0和数据库都是最新的,怎么解决呀刚学完数据库 **c3p0配置文件:** ![图片说明](https://img-ask.csdn.net/upload/202005/26/1590495445_795157.png) **错误信息:** ![图片说明](https://img-ask.csdn.net/upload/202005/26/1590495336_729782.png) 信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hgery9aamg43f4v0ld9h|1e1c931e, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.cj.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hgery9aamg43f4v0ld9h|1e1c931e, idleConnectionTestPeriod -> 0, initialPoolSize -> 10, jdbcUrl -> jdbc:mysql://localhost:3306/jdbctest?useSSL=false&serverTimezone=UTC, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 30, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 100, maxStatements -> 200, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]

在spring的配置文件中配置c3p0和在hibernate的配置文件中配置c3p0有什么区别?

在spring的配置文件中配置c3p0和在hibernate的配置文件中配置c3p0有什么区别? 我最近在学习如何配置struts2+spring+hibernate,其中数据库连接池使用c3p0,一开始在hibernate.cfg.xml中添加c3p0连接的信息如下: ``` <property name="hibernate.connection.provider_class"> org.hibernate.c3p0.internal.C3P0ConnectionProvider </property> <property name="hibernate.c3p0.max_size">20</property> <property name="hibernate.c3p0.min_size">5</property> <property name="hibernate.c3p0.timeout">50000</property> <property name="hibernate.c3p0.max_statements">100</property> <property name="hibernate.c3p0.idle_test_period">3000</property> <!-- 当连接池耗尽并接到获得连接的请求,则新增加连接的数量 --> <property name="hibernate.c3p0.acquire_increment">2</property> ``` 然后找网上的帖子,发现很多c3p0都是配置在spring的配置文件中的,如: ``` <!-- 采用c3p0数据源 --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/hibernate2" /> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="user" value="root" /> <property name="password" value="root" /> <!-- 配置数据库连接池,最大连接数 --> <property name="maxPoolSize" value="20" /> <!-- 配置数据库连接池,最小连接数 --> <property name="minPoolSize" value="1" /> <!-- 指定数据库连接池的初始化连接数 --> <property name="initialPoolSize" value="1" /> <!-- 指定数据库连接池的连接的最大空闲时间 --> <property name="maxIdleTime" value="10" /> </bean> ``` 这两个有什么关系呢?是一个意思?配置了一个地方另一个地方就不用配置了吧?

c3p0连接数据库的时候出现报错

在写项目是出现以下报错:Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hgeby99jtb023ayfd55l|55facbdb, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hgeby99jtb023ayfd55l|55facbdb, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, jdbcUrl -> jdbc:mysql://localhost:3306/bookstore, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 8, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 2, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, statementDestroyerNumActiveThreads -> -1, statementDestroyerNumConnectionsInUseAllUsers -> -1, statementDestroyerNumConnectionsInUseDefaultUser -> -1, statementDestroyerNumConnectionsWithDeferredDestroyStatementsAllUsers -> -1, statementDestroyerNumConnectionsWithDeferredDestroyStatementsDefaultUser -> -1, statementDestroyerNumDeferredDestroyStatementsAllUsers -> -1, statementDestroyerNumDeferredDestroyStatementsDefaultUser -> -1, statementDestroyerNumIdleThreads -> -1, statementDestroyerNumTasksPending -> -1, statementDestroyerNumThreads -> -1, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]是怎么回事?怎样去解决?求大牛指导

关于hibernate3推荐链接池C3p0的问题

听取了大家的建议,于前天(2008-06-28)替换掉了以前tomcat自带的DBCP连接池,改为了C3P0,配置如 下: [code] <property name="c3p0.min_size">10</property><!--连接池的最小连接数--> <property name="c3p0.max_size">50</property><!--最大连接数--> <property name="c3p0.timeout">100</property><!--连接超时时间--> <!--每隔100秒检测连接是否可正常使用 --> <property name="c3p0.idle_test_period">100</property> <!--当池中的连接耗尽的时候,一次性增加的连接数量,默认为3--> <property name="hibernate.c3p0.acquire_increment">3</property> <!--statemnets缓存大小--> <property name="c3p0.max_statements">150</property> [/code] 原来的DBCP配置 [code] <Resource maxActive="200" maxIdle="60" maxWait="-1" /> [/code] 今天(2008-06-30)访问量达到了200,并且某一瞬间并发查询达到了150左右。出现了用DBCP时未出现过的 问题:瞬间打开页面很慢,并有部分用户超时掉线,我估计是我C3P0设置的问题。请大家 给予回答! [b]问题补充:[/b] [quote] 是不是最大连接数50太少了,你说一瞬间打到了150并发 [/quote] 我的理解是:c3p0.max_size达到最大后会自动新建线程,对吗?

c3p0 连接数据库超时问题

我在工程里面使用c3p0做数据库连接池。在测试功能时平方重启应用。发现在重启时出现连接数据库超时。如果重新再重启应用将能够正常连接数据库。 提示超时的速度非常快,正常连接不上数据库会60秒后再提示连接超时。 是否有人遇到同样的问题? c3p0配置如下: ``` <property name="checkoutTimeout">30000</property> <property name="idleConnectionTestPeriod">1200</property> <property name="maxIdleTime">800</property> <property name="maxIdleTimeExcessConnections">120</property> <property name="maxConnectionAge">200</property> <property name="unreturnedConnectionTimeout">1000</property> <property name="maxPoolSize">300</property> <property name="minPoolSize">50</property> <property name="initialPoolSize">50</property> <property name="acquireIncrement">1</property> <property name="numHelperThreads">8</property> ```

使用c3p0连接池是出现了空指针异常

连接不上我的mysql数据库,但是我单独测试又可以连接上,测试代码如下: Connection conn = null; Statement stmt = null; ResultSet rs = null; try { Class.forName("com.mysql.jdbc.Driver"); String url = "jdbc:mysql://localhost:3306/shi"; String name = "root"; String password = "root"; conn = DriverManager.getConnection(url, name, password); String sql = "select * from t_user"; stmt = conn.createStatement(); rs = stmt.executeQuery(sql); while(rs.next()) { String username = rs.getString("name"); System.out.println(username); } } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); } finally { if(rs != null) { try { rs.close(); } catch (SQLException e) { e.printStackTrace(); } } if(stmt != null) { try { stmt.close(); } catch (SQLException e) { e.printStackTrace(); } } if(rs != null) { try { rs.close(); } catch (SQLException e) { e.printStackTrace(); } } } 但是使用c3p0的时候就出问题了: c3p0的配置如下: <?xml version="1.0" encoding="UTF-8"?> <c3p0-config> <default-config> <property name="jdbcUrl">jdbc:mysql://localhost:3306/shi?useUnicode=true&amp;characterEncoding=utf8</property> <property name="driverClass">com.mysql.jdbc.Driver</property> <property name="user">root</property> <property name="password">root</property> <!-- <property name="jdbcUrl">jdbc:oracle:thin:@localhost:1521:orcl</property> <property name="driverClass">oracle.jdbc.driver.OracleDriver</property> <property name="user">scott</property> <property name="password">tiger</property> --> <property name="c3p0.testConnectionOnCheckout">true</property> <property name="acquireIncrement">3</property> <property name="initialPoolSize">10</property> <property name="minPoolSize">2</property> <property name="maxPoolSize">10</property> </default-config> </c3p0-config> 出现的异常如下: kate Tom 2014-8-9 9:31:05 com.mchange.v2.log.MLog 信息: MLog clients using java 1.4+ standard logging. 2014-8-9 9:31:06 com.mchange.v2.c3p0.C3P0Registry 信息: Initializing c3p0-0.9.5-pre8 [built 04-April-2014 04:20:15 -0700; debug? true; trace: 10] 2014-8-9 9:31:06 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource 信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 2sa1hd931f5tqer1kt6lht|2c766a24, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> null, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceUseNamedDriverClass -> false, identityToken -> 2sa1hd931f5tqer1kt6lht|2c766a24, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> null, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ] 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6c3b78cf -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:278) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:158) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1814) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@5c1fe88d is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@53416c84 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:278) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:158) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1814) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:690) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) at jdbcUtils.JdbcUtils.getConnection(JdbcUtils.java:44) at jdbcUtils.TestUtils.main(TestUtils.java:59) Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1422) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:606) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:526) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutAndMarkConnectionInUse(C3P0PooledConnectionPool.java:756) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:683) ... 3 more 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@5c1fe88d is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests. 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@58a2353d -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception: java.lang.NullPointerException at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507) at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476) at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307) at java.sql.DriverManager.getDriver(DriverManager.java:253) at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:278) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:158) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:161) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:147) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44) at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1814) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696) 2014-8-9 9:31:36 com.mchange.v2.resourcepool.BasicResourcePool 警告: Having failed to acquire a resource, com.mchange.v2.resourcepool.BasicResourcePool@5c1fe88d is interrupting all Threads waiting on a resource to check out. Will try again in response to new client requests.

c3p0连接池使用,一直在打印无用日志,好像是一直在创建并销毁连接

使用C3p0连接池时,在空闲状态一直DEBUG打印如下日志,好像是一直在创建并销毁连接,要怎样配置才能够不一直创建销毁,创建后就保留起,如果连接不够再创建。 DEBUG c.m.v.resourcepool.BasicResourcePool - Preparing to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@4ae0cd66 DEBUG c.m.v.c.i.C3P0PooledConnectionPool - Preparing to destroy PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@4ae0cd66 DEBUG c.m.v.c.i.C3P0PooledConnectionPool - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@4ae0cd66 DEBUG c.m.v.resourcepool.BasicResourcePool - Successfully destroyed resource: com.mchange.v2.c3p0.impl.NewPooledConnection@4ae0cd66 DEBUG c.m.v.resourcepool.BasicResourcePool - Checking for expired resources - Fri Sep 27 16:18:25 CST 2019 [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - BEGIN check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - FINISHED check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - Checking for expired resources - Fri Sep 27 16:18:26 CST 2019 [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - BEGIN check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - EXPIRED idle resource: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30 ---> idle_time: 1966; max_idle_time: 1000 [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - Removing expired resource: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30 [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - FINISHED check for expired resources. [com.mchange.v2.resourcepool.BasicResourcePool@2794eab6] DEBUG c.m.v.resourcepool.BasicResourcePool - Preparing to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30 DEBUG c.m.v.c.i.C3P0PooledConnectionPool - Preparing to destroy PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30 DEBUG c.m.v.c.i.C3P0PooledConnectionPool - Successfully destroyed PooledConnection: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30 DEBUG c.m.v.resourcepool.BasicResourcePool - Successfully destroyed resource: com.mchange.v2.c3p0.impl.NewPooledConnection@34b92a30

c3p0异常求解

[code="java"] com.mchange.v2.async.ThreadPoolAsynchronousRunner - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@16597ba APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! com.mchange.v2.async.ThreadPoolAsynchronousRunner -163073277 [Timer-0] WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@16597ba APPARENT DEADLOCK!!! Complete Status: [num_managed_threads: 10, num_active: 10; activeTasks: com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@a1f903 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#4), com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@1e35936 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#8), com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@f5e931 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#7), com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@a0cbf4 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1), com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@ae1f44 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0), com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@186daf2 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#6), com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@906a8d (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2), com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@1438396 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#3), com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@173f6bb (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#9), com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@4b8a67 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#5); pendingTasks: com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@16b9960, com.mchange.v2.resourcepool.BasicResourcePool$6@1227588, com.mchange.v2.resourcepool.BasicResourcePool$6@152658a, com.mchange.v2.resourcepool.BasicResourcePool$6@885610, com.mchange.v2.resourcepool.BasicResourcePool$6@ca3add, com.mchange.v2.resourcepool.BasicResourcePool$6@dea987, com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4beff3, com.mchange.v2.resourcepool.BasicResourcePool$6@1765f99, com.mchange.v2.resourcepool.BasicResourcePool$6@7e7001] [/code] [code="java"] WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner - Task com.mchange.v2.c3p0.stmt.GooGooStatementCache$1@f5e931 (in deadlocked PoolThread) failed to complete in maximum time 60000ms. Trying interrupt(). [/code] 中午重启后运行正常,隔天访问就会这样,求解。。。 附上配置 [code="java"] c3p0.acquireIncrement=3 c3p0.initialPoolSize=3 c3p0.idleConnectionTestPeriod=1800 c3p0.minPoolSize=1 c3p0.maxPoolSize=10 c3p0.maxStatements=100 c3p0.numHelperThreads=10 c3p0.maxIdleTime=600 c3p0.automaticTestTable=C3P0TestTable [/code] 框架用的是SSI

c3p0死锁问题,DEADLOCK!!!

环境是tomcat7 mysql5.6.33 jdk1.7 首先项目部署到tomcat中可以直接启动,用的是本机的mysql数据库, 但是在eclipse中运行项目就报c2p0死锁。修改了连接数也不管用。而且我重装了mysql也不行。eclipse和tomcat用的都是同一个mysql数据库。eclipse重新安装也还是这样子,求高手指导。 十一月 29, 2017 4:03:25 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.70 十一月 29, 2017 4:03:25 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom 信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [105] milliseconds. 十一月 29, 2017 4:03:27 下午 org.apache.catalina.startup.TldConfig execute 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 十一月 29, 2017 4:03:27 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8080"] 十一月 29, 2017 4:03:27 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-bio-8009"] 十一月 29, 2017 4:03:27 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 1988 ms 16:03:27,866 INFO [JForumBaseServlet ] Starting JForum. Debug mode is true 16:03:27,873 INFO [ConfigLoader ] Using cache engine: net.jforum.cache.DefaultCacheEngine 16:03:27,876 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.BBCodeRepository 16:03:27,878 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.RankingRepository 16:03:27,880 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.SmiliesRepository 16:03:27,881 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.ForumRepository 16:03:27,884 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.TopicRepository 16:03:27,887 INFO [ConfigLoader ] Creating an instance of net.jforum.SessionFacade 16:03:27,888 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.PostRepository 16:03:27,889 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.Tpl 16:03:27,891 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.RolesRepository 16:03:27,891 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.SecurityRepository 16:03:27,893 INFO [ConfigLoader ] Creating an instance of net.jforum.repository.BanlistRepository 16:03:27,951 INFO [FileMonitor ] Watching J:\tool\eclipse_mars\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\JForumBBS/WEB-INF/config/languages/en_US.properties 16:03:27,953 INFO [FileMonitor ] Watching J:\tool\eclipse_mars\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\JForumBBS/WEB-INF/config/languages/zh_CN.properties 16:03:27,969 INFO [ConfigLoader ] Loading JDBC driver net.jforum.dao.mysql.MysqlDataAccessDriver 16:03:28,026 INFO [FileMonitor ] Watching J:\tool\eclipse_mars\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\JForumBBS/WEB-INF/config/database/generic/generic_queries.sql 16:03:28,026 INFO [FileMonitor ] Watching J:\tool\eclipse_mars\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\JForumBBS/WEB-INF/config/database/mysql/mysql.sql 16:03:28,027 INFO [FileMonitor ] Watching J:\tool\eclipse_mars\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\JForumBBS/WEB-INF/config/SystemGlobals.properties 16:03:28,102 INFO [MLog ] MLog clients using log4j logging. 16:03:28,127 INFO [C3P0Registry ] Initializing c3p0-0.9.1-pre9 [built 23-September-2006 01:47:24; debug? true; trace: 10] 16:03:28,184 INFO [AbstractPoolBackedDataSource] Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 120000, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 650b287f, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 650b287f, idleConnectionTestPeriod -> 3600, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/jforum?user=root&password=root&autoReconnect=true&useNewIO=false&zeroDateTimeBehavior=convertToNull&useServerPrepStmts=false&dumpQueriesOnException=true&jdbcCompliantTruncation=false&useUnicode=true&characterEncoding=utf8, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 1000, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 5, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 180, usesTraditionalReflectiveProxies -> false ] 16:03:48,172 WARN [ThreadPoolAsynchronousRunner] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@23eb54ea -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! 16:03:48,174 WARN [ThreadPoolAsynchronousRunner] com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@23eb54ea -- APPARENT DEADLOCK!!! Complete Status: Managed Threads: 3 Active Threads: 3 Active Tasks: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@7dec08b1 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@132edd0d (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@69b28a51 (com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2) Pending Tasks: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@4897020d com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@3207c8b6 Pool thread stack traces: Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2,5,main] java.lang.Thread.sleep(Native Method) com.mysql.jdbc.Connection.createNewIO(Connection.java:2828) com.mysql.jdbc.Connection.<init>(Connection.java:1531) com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:120) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:143) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:132) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:129) com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:862) com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:33) com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1527) com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547) Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0,5,main] java.lang.Thread.sleep(Native Method) com.mysql.jdbc.Connection.createNewIO(Connection.java:2828) com.mysql.jdbc.Connection.<init>(Connection.java:1531) com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266) com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:120) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:143) com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:132) com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:129)

c3p0关于mysql8小时的问题

jar包:c3p0-0.9.5-pre6.jar mchange-commons-java-0.2.6.3.jar 背景:以前在使用ORM框架的情况下,使用连接池没出现过空闲连接超时的问题,现在新建个项目没什么框架,使用c3p0,代码如下: [code="java"] private static ComboPooledDataSource ds = null; static { try { ds = new ComboPooledDataSource(); ds.setDriverClass(Constant.DRIVER_CLASS_NAME); ds.setJdbcUrl(Constant.URL); ds.setUser(Constant.USERNAME); ds.setPassword(Constant.PASSWORD); ds.setMaxPoolSize(40); ds.setMinPoolSize(5); ds.setAutomaticTestTable("C3P0TestTable"); ds.setIdleConnectionTestPeriod(1800); ds.setTestConnectionOnCheckin(true); ds.setTestConnectionOnCheckout(true); ds.setMaxIdleTime(25000); } catch (PropertyVetoException e) { gLog.error("ComboPooledDataSource", e); } } public static synchronized Connection getConn() { Connection con = null; try { con = ds.getConnection(); } catch (SQLException e1) { gLog.error("getConn", e1); } return con; } [/code] [color=red]有个线程用 getConn()获取连接后,长时间不进行数据库操作,隔天触发数据库操作时会报异常[/color] [code="java"] com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.SocketException MESSAGE: Software caused connection abort: socket write error STACKTRACE: java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) at com.mysql.jdbc.Connection.execSQL(Connection.java:3176) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:144) ** END NESTED EXCEPTION ** Last packet sent to the server was 0 ms ago. at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2652) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665) at com.mysql.jdbc.Connection.execSQL(Connection.java:3176) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:144) [/code] 有个线程一直有进行数据库操作,则正常,因此判断是MYSQL8小时问题。但是代码里几个重要属性已经配置了,是否哪里还漏了,错了。 求教!

Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource一直出现这个错误

信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hge15za2g72li01hzdk3n|58aaad60, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge15za2g72li01hzdk3n|58aaad60, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/store, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ] java.sql.SQLException: Incorrect string value: '\xAC\xED\x00\x05vr...' for column 'code' at row 1 Query: insert into user values(?,?,?,?,?,?,?,?,?,?) Parameters: [E24F1FD0CFAA4BB1A1DBD1517B3AC036, tom, 123, 汤姆, tom@store.com, 2019-04-21, null, 0, 0, class com.yxd.domain.User] at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:320) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:489) at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:455) at com.yxd.dao.impl.Userdaoimpl.save(Userdaoimpl.java:16) at com.yxd.service.impl.UserserviceImpl.regist(UserserviceImpl.java:16) at com.yxd.web.servlet.UserSerlet.regist(UserSerlet.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.yxd.web.servlet.base.BaseServlet.service(BaseServlet.java:25) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.yxd.web.filter.EncodingFilter.doFilter(EncodingFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)

eclipse里tomcat提示c3p0错误

第二次使用数据库时,提示c3p0错误,请教该怎么办?![图片说明](https://img-ask.csdn.net/upload/201803/09/1520569270_598127.png)

一个Axis问题,一个c3p0问题,谢谢大家

基于Axis1.4开发的web services在Tomcat6下调试正常,可放在Resin3下却出错误, ,错误信息如下。 java.lang.IncompatibleClassChangeError: Class org.apache.axis.MessageContext does not implement the requested interface javax.xml.rpc.handler.MessageContext at org.apache.axis.transport.http.ServletEndpointContextImpl.getServletContext(ServletEndpointContextImpl.java:39) at org.springframework.remoting.jaxrpc.ServletEndpointSupport.init(ServletEndpointSupport.java:84) at org.apache.axis.providers.java.JavaProvider.getNewServiceObject(JavaProvider.java:238) at org.apache.axis.providers.java.JavaProvider.getServiceObject(JavaProvider.java:91) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:287) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at javax.servlet.http.HttpServlet.service(HttpServlet.java:153) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:91) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:187) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:266) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:270) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:678) at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:721) at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:643) at java.lang.Thread.run(Thread.java:619) 2.Resin下部署啦两个网站,都是用啦c3p0,启动时报错, 21:23:02,453 WARN ActiveManagementCoordinator:56 - A C3P0Registry mbean is already registered. This probably means that an application using c3p0 was undeployed, but not all PooledDataSources were closed prior to undeployment. This may lead to resource leaks over time. Please take care to close all PooledDataSources. 21:23:02,453 WARN ActiveManagementCoordinator:69 - Failed to set up C3P0RegistryManager mBean. [c3p0 will still function normally, but management via JMX may not be possible.] javax.management.InstanceNotFoundException: com.mchange.v2.c3p0:type=C3P0Registry at com.caucho.jmx.MBeanContext.unregisterMBean(MBeanContext.java:285) at com.caucho.jmx.AbstractMBeanServer.unregisterMBean(AbstractMBeanServer.java:477) at com.mchange.v2.c3p0.management.ActiveManagementCoordinator.attemptManageC3P0Registry(ActiveManagementCoordinator.java:62) at com.mchange.v2.c3p0.C3P0Registry.attemptRegisterRegistryMBean(C3P0Registry.java:217) at com.mchange.v2.c3p0.C3P0Registry.reregister(C3P0Registry.java:242) at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.<init>(PoolBackedDataSourceBase.java:228) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init>(AbstractPoolBackedDataSource.java:62) at com.mchange.v2.c3p0.ComboPooledDataSource.<init>(ComboPooledDataSource.java:108) at com.mchange.v2.c3p0.ComboPooledDataSource.<init>(ComboPooledDataSource.java:104) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:83) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:911) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:873) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:514) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:169) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:170) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:413) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:735) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:369) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:251) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:190) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at com.caucho.server.webapp.WebApp.start(WebApp.java:1864) at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:667) at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72) at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549) at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:160) at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:659) at com.caucho.server.host.Host.start(Host.java:450) at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:667) at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72) at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:549) at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:160) at com.caucho.server.host.HostContainer.start(HostContainer.java:484) at com.caucho.server.cluster.Server.start(Server.java:1315) at com.caucho.server.cluster.Cluster.startServer(Cluster.java:710) at com.caucho.server.cluster.ClusterServer.startServer(ClusterServer.java:542) at com.caucho.server.resin.Resin.start(Resin.java:703) at com.caucho.server.resin.Resin.initMain(Resin.java:1157) at com.caucho.server.resin.Resin.main(Resin.java:1360)

怎样以c3p0方式连接Oracle数据库

怎样以c3p0方式连接Oracle数据库,搭载ssh框架,求applicationContext.xml配置

使用c3p0连接ORACLE数据库查询不到数据,SQLPLUS执行相同SQL可以查到

搭建一个webservice 使用c3p0连接oracle数据库,在执行查询语句,查询同一条数据的时候,有的时候查询不到结果,而有的时候查询到结果,服务还不报错,在使用SQLPLUS执行该语句的时候每次都能查到结果,求大神帮忙推测一下是什么问题。 使用c3p0创建一个静态的ComboPooledDataSource对象,当需要的时候从这里获取连接 Connection conn = comb.getConnection(); 数据库是按照日期建的分区表,执行查询语句的时候没有按照分区表查询,这会不会有影响。

spring 配置c3p0出问题

使用spring配置c3p0出问题,mysql和c3p0的jar包都导入了,没有语法错误,但是出问题了,配置文件为: <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <!-- 使用属性文件 --> <property name="user" value="${user}"></property> <property name="password" value="${password}"></property> <property name="driverClass" value="${driverClass}"></property> <property name="jdbcUrl" value="${jdbcUrl}"></property> </bean> 异常:警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [bean-dataSource.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.mchange.v2.c3p0.ComboPooledDataSource]: No default constructor found; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/ser/Indirector

tomcat启动 c3p0死锁 ,测试,预发布没问题,生产环境启动c3p0死锁

2020-02-11 18:55:50.449  WARN c     : com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@6a749e11 -- APPARENT DEADLOCK!!! Creating emergency threads for unassigned pending tasks! 2020-02-11 18:55:50.452  WARN [C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-AdminTaskTimer] c.m.v.a.ThreadPoolAsynchronousRunner     : com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@6a749e11 -- APPARENT DEADLOCK!!! Complete Status:      Managed Threads: 3     Active Threads: 3     Active Tasks:          com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@258e6714             on thread: C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-HelperThread-#0         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6bc4e1a2             on thread: C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-HelperThread-#1         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@146123e0             on thread: C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-HelperThread-#2     Pending Tasks:          com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@13c1fbf0         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@45a1985b         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@924a8bc         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@1447f45b         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@8c59358         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@41efa15b         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask@6da29092 Pool thread stack traces:     Thread[C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-HelperThread-#1,5,main]         java.net.SocketInputStream.socketRead0(Native Method)         java.net.SocketInputStream.socketRead(SocketInputStream.java:116)         java.net.SocketInputStream.read(SocketInputStream.java:170)         java.net.SocketInputStream.read(SocketInputStream.java:141)         com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:100)         com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:143)         com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:173)         com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2954)         com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:560)         com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1014)         com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2255)         com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2106)         com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2090)         com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:795)         com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44)         sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)         sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)         sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)         java.lang.reflect.Constructor.newInstance(Constructor.java:423)         com.mysql.jdbc.Util.handleNewInstance(Util.java:404)         com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400)         com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:327)         com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:175)         com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:220)         com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:206)         com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:203)         com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1176)         com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1163)         com.mchange.v2.resourcepool.BasicResourcePool.access$700(BasicResourcePool.java:44)         com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1908)         com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:696)     Thread[C3P0PooledConnectionPoolManager[identityToken->1hge1bfa8eeb65muaq2al|45f13281]-HelperThread-#0,5,main] <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd"> <context:property-override location="classpath:config/properties/connection.properties" /> <!-- ================================= 数据源配置 ============================================= --> <bean id="dataSource1" class="com.mchange.v2.c3p0.ComboPooledDataSource"/> <bean id="dataSource101" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <!--preparedStatement 不会在数据库被 cached导致 连接数的被占用,checkoutOut的时候超时--> <property name="maxStatements" value="0"/> </bean> <bean id="dataSource2" class="com.mchange.v2.c3p0.ComboPooledDataSource"/> <bean id="dataSource3" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <!--preparedStatement 不会在数据库被 cached导致 连接数的被占用,checkoutOut的时候超时--> <property name="maxStatements" value="0"/> </bean> <!-- define the SqlSessionFactory --> <bean id="sessionFactory1" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource1"/> <property name="configLocation" value="classpath:config/mybatis/mybatis-Configuration.xml"/> <property name="mapperLocations"> <array> <value>classpath*:mapper/*Mapper.xml</value> </array> </property> </bean> <bean id="sessionFactory101" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource101"/> <property name="configLocation" value="classpath:config/mybatis/mybatis-Configuration.xml"/> <property name="mapperLocations"> <array> <value>classpath*:mapper/*Mapper.xml</value> </array> </property> </bean> <bean id="sessionFactory2" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource2"/> <property name="configLocation" value="classpath:config/mybatis/mybatis-Configuration.xml"/> <property name="mapperLocations"> <array> <value>classpath*:mapper/*Mapper.xml</value> </array> </property> </bean> <bean name="transactionManager1" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource1"/> </bean> <bean name="transactionManager101" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource101"/> </bean> <bean name="transactionManager2" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource2"/> </bean> <tx:annotation-driven transaction-manager="transactionManager1" /> <tx:annotation-driven transaction-manager="transactionManager101" /> <tx:annotation-driven transaction-manager="transactionManager2" /> <!-- 开启AOP 如果pointcut指向 controller则需要在springmvc的配置文件中配置 --> <aop:aspectj-autoproxy/> <tx:advice id="txAdvice" transaction-manager="transactionManager1"> <tx:attributes> <tx:method name="get*" propagation="REQUIRED" read-only="true" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="save*" propagation="REQUIRED" /> <tx:method name="update*" propagation="REQUIRED" /> </tx:attributes> </tx:advice> <aop:config expose-proxy="true"> <!-- 第一个*代表所有的返回值类型 第一个.代表子包 第二个*代表所有的类 第三个*代表类所有方法 第一个..代表所有的参数 --> <aop:pointcut id="txPointcut" expression="execution(* app.service..*.*(..))" /> <!-- Advisor定义,切入点和通知分别为txPointcut、txAdvice --> <aop:advisor pointcut-ref="txPointcut" advice-ref="txAdvice"/> </aop:config> </beans> ##DB config dataSource1.driverClass=com.mysql.jdbc.Driver dataSource1.jdbcUrl=url dataSource1.user= dataSource1.password= dataSource1.testConnectionOnCheckout=true dataSource1.maxPoolSize=200 dataSource1.minPoolSize=10 dataSource1.initialPoolSize=10 dataSource1.checkoutTimeout=30000 dataSource1.maxIdleTime=30 dataSource1.maxStatements=0 dataSource1.maxStatementsPerConnection=0 dataSource101.driverClass=com.mysql.jdbc.Driver dataSource101.jdbcUrl=url dataSource101.user= dataSource101.password= dataSource101.testConnectionOnCheckout=true dataSource101.maxPoolSize=200 dataSource101.minPoolSize=10 dataSource101.initialPoolSize=10 dataSource101.checkoutTimeout=30000 dataSource101.maxIdleTime=30 dataSource101.maxStatements=0 dataSource101.maxStatementsPerConnection=0 dataSource2.driverClass=com.mysql.jdbc.Driver dataSource2.jdbcUrl=jdbc:mysql://localhost:3306/aaa?useSSL=true&useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false dataSource2.user= dataSource2.password= dataSource2.testConnectionOnCheckout=true dataSource2.maxPoolSize=200 dataSource2.minPoolSize=10 dataSource2.initialPoolSize=10 dataSource2.checkoutTimeout=30000 dataSource2.maxIdleTime=30 dataSource2.maxStatements=0 dataSource2.maxStatementsPerConnection=0 dataSource3.driverClass=com.mysql.jdbc.Driver dataSource3.jdbcUrl=jdbc:mysql://localhost:3306/admin?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false dataSource3.user= dataSource3.password= dataSource3.testConnectionOnCheckout=true dataSource3.maxPoolSize=10 dataSource3.minPoolSize=5 dataSource3.initialPoolSize=5 dataSource3.checkoutTimeout=30000 dataSource3.maxIdleTime=30 dataSource3.maxStatements=0 dataSource3.maxStatementsPerConnection=0

C/C++学习指南全套教程

C/C++学习的全套教程,从基本语法,基本原理,到界面开发、网络开发、Linux开发、安全算法,应用尽用。由毕业于清华大学的业内人士执课,为C/C++编程爱好者的教程。

定量遥感中文版 梁顺林著 范闻捷译

这是梁顺林的定量遥感的中文版,由范闻捷等翻译的,是电子版PDF,解决了大家看英文费时费事的问题,希望大家下载看看,一定会有帮助的

YOLOv3目标检测实战:训练自己的数据集

YOLOv3是一种基于深度学习的端到端实时目标检测方法,以速度快见长。本课程将手把手地教大家使用labelImg标注和使用YOLOv3训练自己的数据集。课程分为三个小项目:足球目标检测(单目标检测)、梅西目标检测(单目标检测)、足球和梅西同时目标检测(两目标检测)。 本课程的YOLOv3使用Darknet,在Ubuntu系统上做项目演示。包括:安装Darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 Darknet是使用C语言实现的轻型开源深度学习框架,依赖少,可移植性好,值得深入探究。 除本课程《YOLOv3目标检测实战:训练自己的数据集》外,本人推出了有关YOLOv3目标检测的系列课程,请持续关注该系列的其它课程视频,包括: 《YOLOv3目标检测实战:交通标志识别》 《YOLOv3目标检测:原理与源码解析》 《YOLOv3目标检测:网络模型改进方法》 敬请关注并选择学习!

sql语句 异常 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

在我们开发的工程中,有时候会报 [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ------ 这种异常 不用多想,肯定是我们的sql语句出现问题,下面...

浪潮集团 往年的软件类 笔试题 比较详细的哦

浪潮集团 往年的软件类 笔试题 比较详细的哦

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

I2c串口通信实现加速度传感器和FPGA的交流

此代码能实现加速度传感器与FPGA之间的交流,从而测出运动物体的加速度。

Python可以这样学(第一季:Python内功修炼)

董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。

微信公众平台开发入门

本套课程的设计完全是为初学者量身打造,课程内容由浅入深,课程讲解通俗易懂,代码实现简洁清晰。通过本课程的学习,学员能够入门微信公众平台开发,能够胜任企业级的订阅号、服务号、企业号的应用开发工作。 通过本课程的学习,学员能够对微信公众平台有一个清晰的、系统性的认识。例如,公众号是什么,它有什么特点,它能做什么,怎么开发公众号。 其次,通过本课程的学习,学员能够掌握微信公众平台开发的方法、技术和应用实现。例如,开发者文档怎么看,开发环境怎么搭建,基本的消息交互如何实现,常用的方法技巧有哪些,真实应用怎么开发。

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

eclipseme 1.7.9

eclipse 出了新的eclipseme插件,官方有下载,但特慢,我都下了大半天(可能自己网速差)。有急需要的朋友可以下哦。。。

Spring Boot -01- 快速入门篇(图文教程)

Spring Boot -01- 快速入门篇 今天开始不断整理 Spring Boot 2.0 版本学习笔记,大家可以在博客看到我的笔记,然后大家想看视频课程也可以到【慕课网】手机 app,去找【Spring Boot 2.0 深度实践】的课程,令人开心的是,课程完全免费! 什么是 Spring Boot? Spring Boot 是由 Pivotal 团队提供的全新框架。Spring Boot...

HoloLens2开发入门教程

本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

最简单的倍频verilog程序(Quartus II)

一个工程文件 几段简单的代码 一个输入一个输出(50Mhz倍频到100Mhz)

计算机组成原理实验教程

西北工业大学计算机组成原理实验课唐都仪器实验帮助,同实验指导书。分为运算器,存储器,控制器,模型计算机,输入输出系统5个章节

4小时玩转微信小程序——基础入门与微信支付实战

这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

基于RSA通信密钥分发的加密通信

基于RSA通信密钥分发的加密通信,采用pycrypto中的RSA、AES模块实现

不同变质程度煤尘爆炸残留气体特征研究

为分析不同变质程度煤尘爆炸残留气体成分的特征规律,利用水平管道煤尘爆炸实验装置进行了贫瘦煤、肥煤、气煤、长焰煤4种不同变质程度的煤尘爆炸实验,研究了不同变质程度煤尘爆炸后气体残留物含量的差异,并对气体

设计模式(JAVA语言实现)--20种设计模式附带源码

课程亮点: 课程培训详细的笔记以及实例代码,让学员开始掌握设计模式知识点 课程内容: 工厂模式、桥接模式、组合模式、装饰器模式、外观模式、享元模式、原型模型、代理模式、单例模式、适配器模式 策略模式、模板方法模式、观察者模式、迭代器模式、责任链模式、命令模式、备忘录模式、状态模式、访问者模式 课程特色: 笔记设计模式,用笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力 笔记标题采用关键字标识法,帮助学员更加容易记住知识点 笔记以超链接形式让知识点关联起来,形式知识体系 采用先概念后实例再应用方式,知识点深入浅出 提供授课内容笔记作为课后复习以及工作备查工具 部分图表(电脑PC端查看):

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

几率大的Redis面试题(含答案)

本文的面试题如下: Redis 持久化机制 缓存雪崩、缓存穿透、缓存预热、缓存更新、缓存降级等问题 热点数据和冷数据是什么 Memcache与Redis的区别都有哪些? 单线程的redis为什么这么快 redis的数据类型,以及每种数据类型的使用场景,Redis 内部结构 redis的过期策略以及内存淘汰机制【~】 Redis 为什么是单线程的,优点 如何解决redis的并发竞争key问题 Red...

手把手实现Java图书管理系统(附源码)

【超实用课程内容】 本课程演示的是一套基于Java的SSM框架实现的图书管理系统,主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的java人群。详细介绍了图书管理系统的实现,包括:环境搭建、系统业务、技术实现、项目运行、功能演示、系统扩展等,以通俗易懂的方式,手把手的带你从零开始运行本套图书管理系统,该项目附带全部源码可作为毕设使用。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/27513 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化

jsp+servlet入门项目实例

jsp+servlet实现班级信息管理项目

winfrom中嵌套html,跟html的交互

winfrom中嵌套html,跟html的交互,源码就在里面一看就懂,很简单

Java面试题大全(2020版)

发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...

python实现数字水印添加与提取及鲁棒性测试(GUI,基于DCT,含测试图片)

由python写的GUI,可以实现数字水印的添加与提取,提取是根据添加系数的相关性,实现了盲提取。含有两种攻击测试方法(高斯低通滤波、高斯白噪声)。基于python2.7,watermark.py为主

Xshell6完美破解版,亲测可用

Xshell6破解版,亲测可用,分享给大家。直接解压即可使用

你连存活到JDK8中著名的Bug都不知道,我怎么敢给你加薪

CopyOnWriteArrayList.java和ArrayList.java,这2个类的构造函数,注释中有一句话 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public ArrayList(Collection&lt;? ...

相关热词 c# 不能序列化继承类 c# char* 调用 c# 开发dll模板 c#添加控件到工具箱 c#控制台组合数 编程计算猴子吃桃问题c# c# wpf 背景透明 随机抽取号码软件c# c# 开发环境 c# 属性和字段
立即提问