Lock request time out period exceeded

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
norwegen60
Posts: 19
Joined: Wed 15 Dec 2010 13:12

Lock request time out period exceeded

Post by norwegen60 » Thu 03 Nov 2011 09:09

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

AndreyZ

Post by AndreyZ » Thu 03 Nov 2011 12:51

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

norwegen60
Posts: 19
Joined: Wed 15 Dec 2010 13:12

Post by norwegen60 » Fri 04 Nov 2011 02:13

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

AndreyZ

Post by AndreyZ » Fri 04 Nov 2011 08:30

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.

norwegen60
Posts: 19
Joined: Wed 15 Dec 2010 13:12

Post by norwegen60 » Thu 17 Nov 2011 11:42

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.

AndreyZ

Post by AndreyZ » Mon 21 Nov 2011 14:54

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.

Post Reply