[Hibernate-JIRA] Closed: (HHH-1482) Connection Pooling Problem
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1482?page=c... ]
Steve Ebersole closed HHH-1482.
-------------------------------
Closing stale resolved issues
> Connection Pooling Problem
> --------------------------
>
> Key: HHH-1482
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1482
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.2
> Environment: Java SDK 1.4.2_06, Windows XP Pro SP2,Oracle 8.1.7 (150 conn.max)
> Reporter: Hakan Cunier
> Priority: Critical
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> Hi,
> I think there is a problem with c3p0 connection pooling. I tried 140 concurrent operations via Threads which starts at sime time. Each thread gets a new Session. Persist some data. Commits the session. Closes the session. Although we 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 hibernate properties file's context
> 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 close session
> t.writeStatus();
> }
> System.out.println("Run Finished");
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 1 month
[Hibernate-JIRA] Closed: (HHH-1474) SchemaUpdate Issue with hbm2ddl.auto property
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1474?page=c... ]
Steve Ebersole closed HHH-1474.
-------------------------------
Closing stale resolved issues
> SchemaUpdate Issue with hbm2ddl.auto property
> ---------------------------------------------
>
> Key: HHH-1474
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1474
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.1.2
> Environment: PostgreSQL 8.1.1 running on Windows XP SP2. JDK 1.4.2.
> Reporter: Grant Ingersoll
> Priority: Minor
> Attachments: hib.tar.gz
>
>
> I am seeing some strange behavior using the hbm2ddl.auto property
> when set to update. I haven't seen anyone else with the same problem,
> so it is probably something I am doing.
> I have a simple mapping file named Junk (XML below). In my configuration file, I have set the hbm2ddl.auto to be update. When I do this, I get an exception when I try to begin a transaction stating that:
> java.sql.SQLException: com.mchange.v2.c3p0.PoolBackedDataSource@edf3f6 [...] has been closed() -- you can no longer use it.
> Now, if I change the hbm2ddl.auto value to be create or create-drop everything works fine in my test. I have included the pertinent test code,
> mapping and hibernate.cfg.xml code as an attachment. When I look at the logs
> I don't see anything too different. Note, that in the case of update, Hibernate is definitely talking to the database when it is starting up,
> it just throws the Exception when I try to open a transaction
> I have done some debugging of this, and it seems that the SchemaUpdate class is calling connectionProvider.close() on line 175, which then proceeds to destroy the data source on line 118 of the C3P0ConnectionProvider class. Then, when I go to begin doing my real work, by opening a transaction, it tries to get a new connection from the Data Source (which for some reason is the one that was just destroyed) and the PoolBackedDataSource throws the offending exception on line 234 because, as far as it is concerned, the Data Source has been destroyed.
> Since SchemaUpdate isn't being called when hbm2ddl.auto is set to create this is never an issue.
> I have my C3P0 properties set as in http://www.hibernate.org/hib_docs/reference/en/html/session-configuration... (which can be seen in the configuration I posted earlier.)
> Posted this on the forum a few days ago and did some debugging at http://forum.hibernate.org/viewtopic.php?t=955212
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 1 month