I currently use a default transaction isolation of READ_COMMITTED and I do not use optimistic (versioning) or pessimistic locking when writing data back to the database so I currently have a problem with lost updates.
I plan to use pessimistic locking, at least for now. I'm trying to find a way to intercept all Query objects generated by Hibernate before they are executed, in order to change the LockMode of any queries executed in a non-read-only transaction to use pessimistic locking. I'm aware of the hibernate interceptor API, but that does not give access to Query objects before execution, and I have not been able to find any other way to get access to Query objects before execution. Any help pointing me in the right direction is appreciated!
Thanks, Ryan
|