Transaction scopes can be used instead, which allows the transaction to be distributed. The Product version is checked by the Hibernate explicit optimistic locking routine. Locking an entire table by reading rows shouldn't happen in any full featured database written in this century. We use optimistic locking with the version column being a timestamp created by MySQL either during insert or during update. The idea is most of these read tables get updated by a batch process during the day and thus lock these tables for read during which the application is unable to read data. (each transaction assumes that no other transaction is going on) using locking approach (put a lock on the data so no other transaction can access that . SQL Server table hints are a special type of explicit command that is used to override the default behavior of the SQL Server query optimizer during the T-SQL query execution This is accomplished by enforcing a specific locking method, a specific index or query processing operation, such index seek or table scan, to be used by the SQL Server query optimizer to build the query execution plan. Hibernate Optimistic Locking - Coderanch Lock wait timeout - Ask TOM - Oracle For any multiversioning database, nothing is going to get locked unless you explicitly lock the row yourself. I need to know, hibernate will do the row level lock after transaction is started. Cause. Sometimes due to long running transactions or slowness lock acquired by one transaction on particular row gets hit by another transaction and blocking sessions happens. JPA. There's no right or wrong length. Make sure you specify a transaction manager in your Spring Configuration (this you need to do anyway). These can be mapping errors, infrastructure problems, SQL errors, data integrity violations, session problems, and transaction errors. Write-behind. This issue can be depicted as follows: Alice fetches a Product. hibernate transaction will lock the row in table(MySQL)