titoose wrote:
I think the flush occurs because in a find operation usually a "select" query is performed, and if hibernate doesn't flush pending operations, current query cannot access to modified values. Timeout is not responsible of flushing.
Example:
Code:
session.save(myObject);
List list = session.find("FROM MyObject");
//previous object is not retrieved if hibernate doesn't flush
Yes, I think you're obviously right. In fact, for example, if not flushing before retrieving instances by find() some triggers could have been not "triggered" and so data would not be up to date at the return of the find().
Very interesting to think about indeed. You helped me to a better understanding of this, I guess, thanks. Maybe some expert could confirm what I suppose, but it seems logical enough, isn't it ?