Yes, you are right - it's better to accomplish with custom SQL statement executed in the scope of the same transaction, which inserts/updates other purchase-related records.
Perhaps, you can also start transaction, then load your object with the property you need to update, ensuring that its record is locked in the DB, then change property, save object and commint transaction. Maybe it's achievable by using LockMode.Upgrade, but i'm not sure, because haven't tried.
_________________ Best,
Andrew Mayorov // BYTE-force
|