Hello,
What sould hibernate do in a situation like this to the result object?
Code:
//transaction, session, and identifier declared above
int i=0;
while (i < 10)
{
Thing result = (Thing) session.load("Thing", identifier);
//the following changes a field in the result object.
result.incrementNumber();
session.saveOrUpdate(result);
i++;
}
//close session and transaction
Now, all of the loads and saves are in the same transaction without any flushes. After the first iteration of this loop, my number variable should be higher than it was before obviously. On the second attempt to do the load(), would I get the object with the number I just saved, or would I get the same object that I got during the first iteration of the loop?