-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate 3 autoflush behavior
PostPosted: Wed Sep 21, 2005 5:44 am 
Newbie

Joined: Fri Sep 09, 2005 11:47 am
Posts: 4
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


Top
 Profile  
 
 Post subject: Am I stupid?
PostPosted: Wed Sep 21, 2005 12:03 pm 
Newbie

Joined: Fri Sep 09, 2005 11:47 am
Posts: 4
Well... 2 days of madness to discover that I wasn't calling beginTransaction on HibernateUtil... No transaction-> No flush...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.