Hi,
first of all, sorry for my english :-(
I'm in trouble using autoflush.
Here is my hibernate.cfg.xml:
Code:
<hibernate-configuration>
<session-factory>
<property name="show_sql">true</property>
<property name="use_sql_comments">true</property>
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.url">jdbc:postgresql://localhost:5432/testDB</property>
<property name="connection.username">dummy</property>
<property name="connection.password">dummy</property>
<property name="c3p0.min_size">5</property>
<property name="c3p0.max_size">20</property>
<property name="c3p0.timeout">1800</property>
<property name="c3p0.max_statements">50</property>
<mapping jar="C:/Programmi/tomcat/webapps/test/WEB-INF/lib/hibernatemappings.jar" />
</session-factory>
</hibernate-configuration>
I'm using the latest HibernateUtil helper class from caveatEmptor.
Hibernate reference says (Page 115, pdf version) :
Quote:
...flush occours by default at the following points:
- before some query executions
- from org.hibernate.Transaction.commit()
- from Session.flush()
Well, I cannot get it to work:
org.hibernate.Transaction.commit() (actually HibernateUtil.commitTransaction()) doesn't flush anything and before query executions nothing happens!
I have to call HibernateUtil.getCurrentSession().flush() by myself.
Is there something special to do to enable autoflushing (Please note that Session.getFlushMode() returns "AUTO")?
Giovanni Romeo