Hi all,
I'm a newbie and just realised that commit and flush are two different beasts.
I
think (please, no offense) the documentation of H. is a bit misleading. That is, in the case one lets h. manage the jdbc connection for us (see 3.4 in the ref. documentation), then one also has to make sure he calls session.connection().commit() before close() ? That is :
Code:
Session session = currentSession();
GlossaryTerm princess = new GlossaryTerm();
princess.setTerm("King");
princess.setDescription("arthur");
session.save(princess);
session.flush(); // Is this really necessary ?
session.connection().commit(); // Really store the data
I think the doc is misleading because it says that if nothing spedcial is done, then H. provides a connection (cool for us newbie !), but (section 9.7.2) it also says that "If you are managing JDBC transactions yourself..." you should call commit(). My misunderstanding comes from the fact that I assume that if h. gives a connection to me, then I'm not managing it myself (so I don't have too commit(), which seems wrong because if I don't do it, the data doesn't end in the database).
So am i plainly wrong or just too dumb to read the doc correctly (then I appreciate if one can show me what I missed) or, right ?
thx,
stF