Page 1 of 1

Lock request time out period exceeded

Posted: Thu 03 Nov 2011 09:09
by norwegen60
Dear all,

last time (since UniDac 4.xx ??) my customer got increased messages of locked records.

Case 1:
People want to edit datas but a whole range (in the analyced case 44 records) are locked although the records where created 3 weeks before and no one is working on them. I got also in MsSQL Server Management Studio the message that the datas where locked

Case 2:
Yesterday my customer got the message
Lock request time out period exceeded
trying to open the SQL

Code: Select all

SELECT ID, NrCleaned, Benennung, HK, AendInd
FROM PPS_Artikel
ORDER BY NrCleaned
I got also the message, opening the TUniQuery direct in the Delphi IDE. Opening the same SQL in MsSQL Server Management Studio works without problem. After restarting the MsSQL Services also TUniQuery can open the SQL.
  • All TUniQuerys are with LockMode = ImNone
    The tabel has 42000 record
    the Databbase is MsSQL 2008 R2
    UniDac version 4.0.2
    Delphi XE
best regards
Gerd

Posted: Thu 03 Nov 2011 12:51
by AndreyZ
Hello,

Please check that all TUniQuery, TUniTable, and TUniStoredProc components in your application have the LockMode property set to lmNone, and that you do not use the Lock method of these components. Also note that SQL Server performs locking itself too. Please take a look at these articles:
http://msdn.microsoft.com/en-us/library/ms190615.aspx
http://msdn.microsoft.com/en-us/library/ms184286.aspx

Posted: Fri 04 Nov 2011 02:13
by norwegen60
Hello,

as I said before: All LockMode = ImNone. I checked this by searching in all files (*.*) for the text LockMode.

Could it be that there is a correlation between the change from V3.70 to 4.00?

best regards
Gerd

Posted: Fri 04 Nov 2011 08:30
by AndreyZ
The point is that the TUniTable.LockMode property is lmOptimistic by default, so it will not be in any of the files of your application unless you changed it to another value. Please check if your application uses TUniTable components and if it does, please set the LockMode property of all of TUniTable components to lmNone.

Posted: Thu 17 Nov 2011 11:42
by norwegen60
I don“t use any TUniTable. Only TUniQuery and these are by default ImNone. Right? If I changed a TuniQuery to imOptimistic I got an entry LockMode = imOtimistic in the dfm file.

Posted: Mon 21 Nov 2011 14:54
by AndreyZ
This problem can be also caused by transactions usage. When a READCOMMITTED transaction is started, it's impossible to read rows which were modified in this transaction before committing changes. An attempt to read such rows will raise the "Lock request time out period exceeded" error. This is a specificity of SQL Server work.