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.  [ 1 post ] 
Author Message
 Post subject: auto flush question
PostPosted: Sat Jan 03, 2009 6:31 am 
Newbie

Joined: Sat Jan 03, 2009 5:14 am
Posts: 2
hi,
I have small issue with the flushing
I suppose I don't quite understand the flushing mechanism but as far as I know the flush should occur between DML and a select statement (if flush mode is AUTO). Is that correct ?
so I'm using hibernate core 3.3.1 GA and I'm doing this:
Code:
Currency newCurrency = new Currency();
newCurrency.setCurrency(currency);
hbsession.save(newCurrency);
Query query = hbsession.createQuery("from hibernate_mappings.Currency");
query.list(); // here I get old data i.e. no new line has been inserted

of course this works if I use the Transaction API or if I explicitly call flush()
but I don't need transaction here and I also don't want to call flush every time such piece of code is executed

Is this a problem or my understanding of flush is incorrect ? Or am I doing something wrong ?


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

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.