-->
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: c3p0 Pooling Problem
PostPosted: Tue Feb 14, 2006 12:55 pm 
Newbie

Joined: Tue Feb 14, 2006 12:50 pm
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.2

Hi,
I think there is a problem with c3p0 connection pooling. I tried 140
concurrent operations via Threads which starts at same time. Each
thread gets a new Session. Persists some data. Commits the session.
Closes the session. Although i set c3p0 max connection to 140 it
throws an error as java.sql.SQLException: ORA-00020: maximum number of processes (150) exceeded. When i set c3p0 max connection <100 it works correctly. What is going on?

Can you help me?
Here is the hibernate properties file's content hibernate.connection.driver_class = oracle.jdbc.driver.OracleDriver hibernate.connection.url = jdbc:oracle:thin:@127.0.0.1:1521:EDYS
hibernate.connection.username = edys2
hibernate.connection.password = edys2
hibernate.connection.autocommit = false
hibernate.dialect = org.hibernate.dialect.OracleDialect
#DBCP Open Source Connection Pooling Parameters
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=140 ---> when set as lower like (80 or 10) there is no problem
hibernate.c3p0.timeout=300
hibernate.c3p0.max_statements=7500
hibernate.c3p0.acquire_increment=1
here is threads code(given for telling the idea):
class testRun implements Runnable {
public void run() {
System.out.println("Run Started");
long starttime =System.currentTimeMillis()+3000;
for (int i=0; i<140;i++ ){
long sleeptime=starttime-System.currentTimeMillis();
testThread t = new testThread(i+50,sleeptime);
t.start();//it gets a session, save data to one table,commits and closes session
t.writeStatus();
}
System.out.println("Run Finished");
}
}


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 15, 2006 6:44 am 
Regular
Regular

Joined: Tue Nov 29, 2005 12:31 pm
Posts: 75
Hi,

I think your problem is in your database definition not in hibernate. Consult a DBA and increase the number of processes.

I hope it's the right answer (I'm not a database expert).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 6:46 am 
Newbie

Joined: Tue Feb 14, 2006 12:50 pm
Posts: 2
Thanks for your reply.

But with same database i can use 150 connections at the moment without hibernate+c3p0. Also, we set c3p0 max connections as 140, not as 150.

So the problem is not with oracle or oracles configuration.

That may be hint: Most of the connections that retrieved by hibernate+c3p0, runs alter session set <some regional settings>.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 8:13 am 
Regular
Regular

Joined: Tue Nov 29, 2005 12:31 pm
Posts: 75
Hi,

Ok, let's see the code where you get the session and the code where you clean the session.


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.