Hello friends -
Hibernate 3.2./C3P0 .9/Oracle 10g
OK. I have a low frequency, high volume operation; i.e., no data, no data, no data, several thousand rows of data. This has worked fine (at least within a context of c3po/Hibernate/Oracle connects) in the past when I got up to 2K records in one alert (i.e., per minute). Essentially I get an array of N values, then for each value, must make two lookups from a different database.
Today I got 7K in one swipe and I started seeing ORA-01000 errors after some work got done. Here's my .cfg.xml file:
<session-factory> <property name="connection.url">jdbc:oracle:thin:@whatever:1521:sid</property> <property name="connection.username">user</property> <property name="connection.password">pw</property> <property name="dialect">org.hibernate.dialect.Oracle9iDialect</property> <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> <!-- CONNECTION POOLING PROPERTIES --> <!-- configuration pool via c3p0--> <property name="hibernate.c3p0.acquire_increment">5</property> <property name="hibernate.c3p0.idle_test_period">300</property> <!-- seconds --> <property name="hibernate.c3p0.max_size">100</property> <property name="hibernate.c3p0.max_statements">25</property> <property name="hibernate.c3p0.min_size">5</property> <property name="hibernate.c3p0.max_size">50</property> <property name="hibernate.c3p0.timeout">300</property> <!-- seconds --> <mapping resource="LookupRecord.hbm.xml" /> </session-factory>
For each record, I perform two lookups each with a query I create; i.e.,
At a high level, my psuedocode looks like this.
getSession(); beginTransaction();
Loop through array. For each
Query query1 = getSession().createQuery(sql.toString()); do work;
Query query2 = getSession().createQuery(sql2.toString()); do work;
tx.commit(); session.close();
The internet tells me that I am not appropriately closing my statements / resultsets, that eventually lands me in ORA-01000 land, but I don't really (seem to) have access to those objects. Can I force GC on my Query objects to free things up? What am I doing wrong?
This process works fine in situations if I get 2K records to process one minute and 2K records three minutes later.
Any insight is <i>greatly</i> appreciated.
brian
|