-->
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.  [ 4 posts ] 
Author Message
 Post subject: number of connections increase
PostPosted: Tue Feb 03, 2004 9:30 am 
Regular
Regular

Joined: Thu Dec 25, 2003 12:33 am
Posts: 58
Location: Campina Grande, Brasil
I can't get the number of connections to get constant. In the hibernate.properties file, i have this:
Code:
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=org.gjt.mm.mysql.Driver
hibernate.connection.url=jdbc:mysql://localhost/thedbname
hibernate.connection.username=theusername
hibernate.connection.password=thepassword
hibernate.connection.pool_size=3


Isn't it supposed to keep the number of active connections alwais in "3" ? every new database access i do with my application , i get an increment :


Code:
977 ?        S      0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
1002 ?        S      0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
1012 ?        S      0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
1018 ?        S      0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock

If i request a new list of active connections after every request i do with my application, i have a higher number, until my application crashes (in fact, the db crashes).

After every SessionFactory, and after the queries, i always session.flush and session.close.
What am i missing ?

Thanks in advance

_________________
Ot


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2004 12:17 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Don't use hibernate internal connection pool in production. Use your app server one or one whom Hibernate provide conenctors :
c3p0
dbcp
proxool

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2004 4:04 pm 
Regular
Regular

Joined: Thu Dec 25, 2003 12:33 am
Posts: 58
Location: Campina Grande, Brasil
Would someone show a tutorial or a part of the hibernate docs where i could take a look at this? This is a completely new issue to me...I have to read about using these other features.

Thanks for the advice

_________________
Ot


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 03, 2004 6:29 pm 
Regular
Regular

Joined: Thu Dec 25, 2003 12:33 am
Posts: 58
Location: Campina Grande, Brasil
thanks to the help. I got it working ;)

_________________
Ot


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.