Hibernate version 3.2.4
We are attempting to speed up our Hibernate generated SQL running against an Oracle database. A db trace of the Oracle db indicates that each execution of a SQL statement causes a re-parse (and recompilation?) of the statement.
As far as I know, Hibernate should use Prepared Statements 'under the hood' by default. Is that true? If so, the statements shouldn't be getting reparsed.
Another possibility is that the size of the prepared statement cache is too small. Is there a way - via the hibernate.cfg.xml file - to increase the size to the DB/JDBC driver's prepared cache?
I've seen this option used in DataSource configuration files:
prepared-statement-cache-size
Is there a way to specify this in the hibernate.cfg.xml file?
FWIW,
Here are the relevant settings in our hibernate.cfg.xml file:
<property name="hibernate.jdbc.batch_size">1000</property>
<property name="hibernate.jdbc.fetch_size">200</property>
<property name="hibernate.default_batch_fetch_size">32</property>
<property name="hibernate.jdbc.use_get_generated_keys">true</property>
<property name="hibernate.max_fetch_depth">5</property>
<property name="hibernate.connection.pool_size">1</property>
<property name="hibernate.connection.autocommit">false</property>
<property name="hibernate.cache.use_query_cache">false</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
|