lokeshc wrote:
Hi Jordan,
A flush causes the sql statements to be prepared. And these get executed at the transaction commit time.
So, in case where flush() is manually invoked after a save()/update(), the sql gets generated at that time itself and they get executed at tx commit time.
However if a flush() is not manually called, the sql gets both generated and executed at the tx commit time itself(Happens only if the flush mode is auto or commit).
The only scenario where the sql does not get generated and save()/update() will not work will be if flush mode is specified as Manual and the flush() is not invoked manually.
Hope this helps,
Hi,
Yes - what you have written is exactly what I would expect.
However, this is not the behaviour I am seeing in a .NET Nhibernate application. I am seeing SQL generated when I call merge despite the fact the the flush mode is set the 'NEVER' and flush is not invoked manually. I have not had time to test how java hibernate behaves - that is why I thought I would ask here first. When I get time I'll write a test.
regards,
Jordan