【问题标题】:MySQLSyntaxErrorException: User already has more than 'max_user_connections' active connectionsMySQLSyntaxErrorException:用户已经有超过 'max_user_connections' 的活动连接
【发布时间】:2014-06-14 15:54:41
【问题描述】:

直接从 servlet 访问时出现此错误

public class UpdateFloorEventServlet extends HttpServlet {  

@Override
@Transactional(readOnly=true)
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());

    try {

    FloorDAO floorDAO = (FloorDAO)context.getBean("floorDAO");

...

我想我应该增加定义的数据源中的连接,但我不知道如何

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
             p:dataSource-ref="dataSource"  
             p:packagesToScan="com.confloorapp.domain"
             />

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" 
destroy-method="close" 
p:driverClass="${jdbc.driverClassName}" 
p:jdbcUrl="${jdbc.url}"
p:user="${jdbc.username}"
p:password="${jdbc.password}"
p:acquireIncrement="5"
            p:idleConnectionTestPeriod="60"
            p:maxPoolSize="100"
            p:maxStatements="50"
            p:minPoolSize="10" 
/>

【问题讨论】:

    标签: mysql database spring-mvc spring-jdbc application-pool


    【解决方案1】:

    安装 DOA 的服务解决了这个问题: FloorService floorService = (FloorService)context.getBean("floorService");

    【讨论】:

      猜你喜欢
      • 2012-07-01
      • 2017-12-21
      • 1970-01-01
      • 1970-01-01
      • 2014-05-20
      • 2011-05-04
      • 2010-10-21
      • 2016-08-01
      相关资源
      最近更新 更多