Hi everyone:
There is a problem puzzled me all the time. We load an object from database in this way :
Code:
Trade trade=(Trade)session.load(Trade.class,trade_id);
trade.setName(....);
trade.setContent(...);
session.update(trade);
But I think there is a problem! If two thread load the same object and change it in the same time, what will happened?
Whether the data in database will be not identical? I mean that they will be not consistent. Or the database will be lock a long time when it in a long transaction.
I don't use Lock Modal because it is not need to do this everytime I load an object. Some one give me some idea? Help!