Some entities on my application needs to be locked during the scope of a certain transaction. I need to lock all the entities that take part in the transaction and would't like to create special methods for locking the entities on my DAO. I am using spring's declarative transaction and set the isolation level for that particular method call, but when the data are fetched the generated SQL query, is a normal SELECT and not a SELECT XXX FOR UPDATE. Do I have to manually specify the lock on each participating entity on the transaction on hibernate? Shouldn't this be controlled from the transaction isolation? When setting the lock mode to UPDATE on hibernate's session I can see the correct query, does that mean that I need to manually specify the lock even though I have already specified the isolation.
Best