Hi vijay.maddala
I think there is connection leak in your code .Try to find it and while running your application monitor connection pool in MySQl.If all connection are utilized then increase pool size. pool size should be in limit of 250.which is average. Also you could set pool size in cfg file.
Try Use c3p pool connection .It has very good pooling mechanism.
have a look
http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html
Hibernate is leaking JDBC connections!
There are three possible reasons why Hibernate might not be closing connections
You are forgetting to call Session.close().
This is the most common cause. Consider carefully how you are handling sessions. Are you sure you create only one Session per transaction? Are you certain you close the Session even if an exception occurs (ie. in a finally block).
Hibernate issues a warning in the log when an unclosed session is garbage collected, so looking there is a good place to start.
Hibernate is doing connection pooling.
Which ConnnectionProvider are you using? If its not DatasourceConnectionProvider, then it is probably doing connection pooling. This can cause problems in certain environments. Pooling may be disabled for DriverManagerConnectionProvider by setting hibernate.connection.pool_size=0 in hibernate.properties.
You are supplying your own connection.
If you supply your own JDBC connection to SessionFactory.openSession(), Hibernate does not close it from Session.close().
In any case, you can always bypass Hibernate's Connection and transaction handling altogether. For example, the following code block shows the application managing connections and transactions manually:
Session s = sf.openSession( getMyJDBCConnection() ); //supply a JDBC connection
try {
// do some work
s.connection().commit();
}
catch (Exception e) {
s.connection().rollback();
}
finally {
s.close().close(); //close the session and user-supplied JDBC connection
}