Beginner |
 |
Joined: Thu Jan 22, 2004 6:16 am Posts: 40 Location: Luxembourg
|
This problem only occurs on a MSSQL database. When I am doing a Select query, the table which that is done on is being locked.
So when another process tries to query it, a deadlock occurs after a time giving this error : java.sql.SQLException: Transaction (Process ID 55) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
A solution would to add a NOLOCK when doing the Select query as follows (just an example):
SELECT COUNT(field1) FROM Users WITH (NOLOCK) WHERE field1 LIKE 'HELLO'=20=20
Can this be achieved with Hibernate in some way ?
|
|