Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Too many clients already
PostPosted: Sun Dec 20, 2009 7:08 am 
Newbie

Joined: Sun Dec 20, 2009 6:57 am
Posts: 1
Hi to everybody, I am new to this forum and quite new also to Hibernate. I am developing a web application using Spring+Hibernate and PostegreSQL as db. I am having trouble with the following error:

Code:
NDP-DS-------------> [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 0, SQLState: 53300>
NDP-DS-------------> [org.hibernate.util.JDBCExceptionReporter] - <FATAL: sorry, too many clients already>
NDP-DS-------------> [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 0, SQLState: 53300>
NDP-DS-------------> [org.hibernate.util.JDBCExceptionReporter] - <FATAL: sorry, too many clients already>
Dec 20, 2009 12:01:09 PM org.zkoss.zk.ui.impl.UiEngineImpl handleError:1130
SEVERE: >>org.hibernate.exception.GenericJDBCException: Cannot open connection
[SQL: 0, 53300]
>>org.postgresql.util.PSQLException: FATAL: sorry, too many clients already


I searched the web and did find some other people experiencing the same issue but nothing seemed related to my case. I don't even know exactly if the problem is related to hibernate or postgres (or maybe spring).
Here you are the configuration part for spring:

Code:
<bean id="sessionFactory"
      class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
      <property name="dataSource" ref="dataSource" />
      <property name="namingStrategy" ref="namingStrategy"/>
      <property name="packagesToScan" value="somePackage"/>
      <property name="hibernateProperties">
         <props>
            <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
            <prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
                <prop key="hibernate.use_sql_comments">${hibernate.use_sql_comments}</prop>   
            <prop key="hibernate.dialect">${hibernate.dialect}</prop>
            <prop key="hibernate.c3p0.minPoolSize">${hibernate.c3p0.minPoolSize}</prop>
            <prop key="hibernate.c3p0.maxPoolSize">${hibernate.c3p0.maxPoolSize}</prop>
            <prop key="hibernate.c3p0.timeout">${hibernate.c3p0.timeout}</prop>
            <prop key="hibernate.c3p0.max_statement">${hibernate.c3p0.max_statement}</prop>
            <prop key="hibernate.autoReconnect">${hibernate.autoReconnect}</prop>
                 <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
            <prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
         </props>
      </property>
   </bean>


and here is the way I usually do a query:

Code:
return getSession().createQuery(queryString).list();

(I am implementing in my class HibernateDaoSupport one).
Any idea? Am I doing something wrong?
Thank you very much for your help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

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 2015, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.