This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes A ResourcePool could not acquire a resource from its primary factory or source. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "A ResourcePool could not acquire a resource from its primary factory or source." Watch "A ResourcePool could not acquire a resource from its primary factory or source." New topic
Author

A ResourcePool could not acquire a resource from its primary factory or source.

Elizabeth Liew
Greenhorn

Joined: Jun 04, 2008
Posts: 6
Hi,

The problem appeared only after a while of using the application. This most probably is caused by hibernate cfg configuration but i have no idea on how to solve this.

The below are the stack trace. Please help. Thanks.

Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Howdy Greenhorn.

Have you run out of database connections? Get your resource monitor counting them.

-Cameron McKenzie
Elizabeth Liew
Greenhorn

Joined: Jun 04, 2008
Posts: 6
Hi Cameron McKenzie,

May i know how to check the resource monitor?

The DB for the application is MS SOL 2005.

The hibernate.cfg.xml configuration for cfg part is as below. Is there any need to do adjustment?

<property name="connection.username">sa</property>
<property name="connection.password">password</property>
<property name="show_sql">false</property>
<property name="c3p0.acquire_increment">5</property>
<property name="c3p0.idle_test_period">10</property> <!-- seconds -->
<property name="c3p0.min_size">5</property>
<property name="c3p0.max_size">300</property>
<property name="c3p0.timeout">1</property>
<property name="c3p0.max_statements">300</property>
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

The Resource Monitor/Performance Monitor gets installed with the Application Server, I believe.

-Cameron McKenzie
 
wood burning stoves
 
subject: A ResourcePool could not acquire a resource from its primary factory or source.
 
Similar Threads
Conflict with Hibernate's Pool and Mysql?
Totally stuck , where to go now [Cannot open connection; javax.persistence.PersistenceException]
An attempt by a client to checkout a Connection has timed out.
java.net.SocketException: No buffer space available (maximum connections reached?): JVM_Bind
Problems to connect to mysql with hibernate