7
回答
druid1.01与hibernate3.31, spring 2.5兼容吗?
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

@wenshao 你好,想跟你请教个问题:

我们项目用的是mysql5.6,hibernate3.31,spring2.5,之前一直使用的c3p0,运行也一直稳定,后来替换到druid1.01,系统经常报不能获取连接测错误,在mysql的show processlist 也能看到很多连接被使用很长时间,这个是兼容的问题吗,我们在替换druid时,只是改了hibernate的配置文件,代码没有变动。


Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:74)
at com.sun.proxy.$Proxy27.getTransactionIsolation(Unknown Source)
at org.springframework.jdbc.datasource.DataSourceUtils.prepareConnectionForTransaction(DataSourceUtils.java:173)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:444)
... 30 more
Caused by: com.alibaba.druid.pool.GetConnectionTimeoutException: wait millis 60000, active 50
at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1071)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:898)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4534)
at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:661)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4530)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:880)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97)
at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
... 35 more
ERROR [24 Dec 2013 12:38:02,854] 
?

举报
mattsuo
发帖于4年前 7回/621阅
顶部