Hello.
I'm using Unidac 3.50 with Delphi 7.
I'm having some problems with this error: "Lock request time out period exceeded" in some querys.
I'm trying to change the lock type of all my querys to pessimistic but I have literally hundreds of querys (some created dinamically and some at design time).
So, my question is: is there any way to tell my application that all TuniQuerys have pessimistic lock? Or is there a way to make the lock pessimistic by default?
Thanks in advance.
Regards
Goncalo Martins
Change the lock type of all TUniQuery
Hello,
There are several ways to set the LockMode property to lmPessimistic by default :
1. Create a successor of the TUniConnection class and override the RegisterClient method like:
in this case the LockMode property in all TCustomUniDataSet objects, which are associated with the TMyUniConnection object, will be set to lmPessimistic.
2. Create a successor of the TUniTable class and set the LockMode property to lmPessimistic in the constructor, and use this class instead of the standard TUniTable one.
There are several ways to set the LockMode property to lmPessimistic by default :
1. Create a successor of the TUniConnection class and override the RegisterClient method like:
Code: Select all
procedure TMyUniConnection.RegisterClient(Client: TObject;
Event: TConnectChangeEvent);
begin
inherited;
if Client is TCustomUniDataSet then;
TCustomUniDataSet(Client).LockMode := lmPessimistic;
end;2. Create a successor of the TUniTable class and set the LockMode property to lmPessimistic in the constructor, and use this class instead of the standard TUniTable one.