-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: MySQL - too many connections problem
PostPosted: Mon Jul 16, 2007 1:01 am 
Newbie

Joined: Wed Dec 27, 2006 2:25 am
Posts: 9
Location: Chennai-India
hi,

i am using hibernate 2.0 and mysql 5.0 in my struts application.
i have been asked to verify the mysql connection string in the applicatin as too many connections occuring in the mysql server.

can any one suggest where to start on this issue?


Top
 Profile  
 
 Post subject: Re: MySQL - too many connections problem
PostPosted: Mon Jul 16, 2007 4:28 am 
Regular
Regular

Joined: Fri Dec 17, 2004 10:38 am
Posts: 54
logudotcom wrote:
can any one suggest where to start on this issue?


I suppose first place to start is your datasource connection pool size.
Second - since you use hibernate2 and there are no contextual sessions in hbm2, check session closing after each transaction/request.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 16, 2007 4:40 am 
Newbie

Joined: Wed Dec 27, 2006 2:25 am
Posts: 9
Location: Chennai-India
sorry, i use hibernate 3... and the below are the datasource details,

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<session-factory>
<property name="connection.username">testuser</property>
<property name="connection.url">jdbc:mysql://test:3306/testdb</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="myeclipse.connection.profile">TEST</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.pool_size">10</property>

<property name="show_sql">false</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="connection.password">tests</property>

<!-- start c3p0 connection properties -->
<property name="c3p0.min_size">10</property>
<property name="c3p0.max_size">100</property>
<property name="c3p0.timeout">20</property>
<property name="c3p0.acquireRetryAttempts">30</property>
<property name="c3p0.acquireIncrement">5</property>
<property name="c3p0.idleConnectionTestPeriod">900</property>
<property name="c3p0.initialPoolSize">20</property>
<property name="c3p0.maxPoolSize">100</property>
<property name="c3p0.maxIdleTime">300</property>
<property name="c3p0.maxStatements">200</property>
<property name="c3p0.minPoolSize">10</property>
<!-- end c3p0 connection properties -->

****************


i checked my source ... i have been closing the data source in each method in the class

session.close() is called....

then what could be the problem


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 16, 2007 11:24 am 
Regular
Regular

Joined: Fri Dec 17, 2004 10:38 am
Posts: 54
well, you have at least 20 and at most 100 connection open, with step 5 connection. So you never get less than 20 connections.

Alternatively you can enable debugUnreturnedConnectionStackTraces and unreturnedConnectionTimeout c3p0 options (consult c3p0 documentation about hibernate aliases for these properties) and see do you have any connection leak.


Last edited by fuzebest on Mon Jul 16, 2007 4:07 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 16, 2007 12:28 pm 
Newbie

Joined: Wed Dec 27, 2006 2:25 am
Posts: 9
Location: Chennai-India
ok ...i will try on these method and let you know.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.