From: Gavin K. <ga...@ap...> - 2002-10-02 07:59:09
|
> session.setLockMode( LockMode.NONE ); Not really desirable (or possible to implement?), because 1. objects loaded by outerjoining cannot by loaded in any other mode than SHARED. 2. locks are always released at transaction commit time, which means you have to reacquire them explicitly and theres several other complications which would make the semantics of session.setLockMode(LockMode.EXCLUSIVE) very doubtful. > Also, just out of curiosity, is there any support for implementing > pessimistic locking for databases that don't support it directly? E.g. one > lo-tech way is to require a "locked" column in the table in question, which > is set to true to lock the record, and reset when the record is updated and > the lock released. I'm not suggesting that Hibernate should implement this Ah, I think its an undesirable kind of approach (theres all kind of problems with releasing locks in failure modes) that would bloat Hibernate considerably. And, as you say, it can be done at an application-level if necessary. |