"Lock request time out period exceeded"

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Grupo77
Posts: 2
Joined: Wed 13 Oct 2010 10:13
Location: SPAIN

"Lock request time out period exceeded"

Post by Grupo77 » Wed 13 Oct 2010 10:37

I always get this error in my application in a concret scenario.

An user is stopped with a transaction open, the commit is not done yet. This user has done a lot of selects and a few updates (5) trough the transaction.

When another user try to read (make a select) through a new transaction in a specific table gets this error: "Lock request time out period exceeded".

I have change TMSConnectionOptions.DefaultLockTimeout to 6000, 15000... but always I receive the same error.

I have a configuration that enables or not the SDAC components. Without SDAC (through ADO native delphi components) everything performs well, but when I active SDAC (4.80) I get this error.

Must I change any other configuration? Can anybody help me?

Any comment is welcome.


Ferran.

AndreyZ

Post by AndreyZ » Thu 14 Oct 2010 12:44

Hello,

Please check that all your tables have a Primary Keys. When a table doesn't have a Primary Key and you are trying to lock the record, the whole table will be locked instead of one record.

Grupo77
Posts: 2
Joined: Wed 13 Oct 2010 10:13
Location: SPAIN

Post by Grupo77 » Fri 15 Oct 2010 06:37

Thanks AndreyZ.

All my tables heve Primary Keys.

I found one solution. My application is running on a computer where is installed the "SQL Server Native Client".

The standard components that Delphi owns perform well because don't use the Native Client of SQL Server.

I change the TMSConnectionOptions.Provider property to "prSQL" and then the error disappeared. Don't ask me why. I don't know why using the Native Client I got this error.

This solution is good enough for me, I don't use any "SQL Server Native Client" special fuctionallity.

Ferran.

AndreyZ

Post by AndreyZ » Fri 15 Oct 2010 07:21

It is good to see that this problem has been solved.

Post Reply