Hi,
apologies for the seeming randomness of my questions but I have succesfully integrated Hibernate into my app and there were a bunch of questions i had but no one to ask and I was not able to find it in the docs:
Here's my hibernate.cfg.xml file:
Code:
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="hibernate.connection.password">@db.password@</property>
<property name="hibernate.connection.url">
jdbc:oracle:thin:@@db.servername@:@db.port@:@db.sid@
</property>
<property name="hibernate.connection.username">@db.username@</property>
<property name="hibernate.default_schema">
APP_DATA
</property>
<property name="hibernate.dialect">
org.hibernate.dialect.OracleDialect
</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.jdbc.fetch_size">50</property>
<property name="hibernate.connection.pool_size">0</property>
<!-- mapping files -->
<mapping resource="com/acme/ifst/domain/Country.hbm.xml" />
<mapping resource="com/acme/ifst/domain/Occupation.hbm.xml" />
<mapping resource="com/acme/ifst/domain/Industry.hbm.xml" />
<mapping resource="com/acme/ifst/domain/HoldMail.hbm.xml"/>
<mapping resource="com/acme/ifst/domain/DocumentType.hbm.xml"/>
<mapping resource="com/acme/ifst/domain/PartyType.hbm.xml"/>
</session-factory>
</hibernate-configuration>
1. Is the connection pooling OFF from Hibernates perspective? I need it to be because pooling is done at a driver level. I read there was an internal connection pool that could be used in no other one was specified.
2. The hibernate.jdbc.fetch_size value affects how many rows are returned in each db round trip? So if i want to 200 rows and the value is 50, there will be 4 round trips?
3. Do i need to explicitly turn auto-commit OFF? I am using Spring's HibernateTransactionManager.
4. Is there some way to dynamically find the class mapping files instead of declaring them?
5. How do I enable caching? And more importantly, flush the cache programmatically whenever i need to?
Thanks
R