SQL Server and concurrent select/update

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
chkaufmann
Posts: 82
Joined: Sat 01 Jul 2006 11:42

SQL Server and concurrent select/update

Post by chkaufmann » Wed 07 May 2014 05:28

Hi,

I use SQL Server 12, native client and MARS activated. First I run a select with a join on two table to do some validation. During iterating over all rows, I do updates on selected records.

Everything worked fine for over a year now, but it seems since the update to UniDAC 5.2, this doesn't work anymore, if I want to set a "Date" field to something else than "null" in my update statement. I always get an error like "Lock request time out period exceeded."

My select statement is

Code: Select all

select 
  A.ALLNAMES, A.ATHLETEID, A.CLUBID, A.CLUBID_ALT, A.FIRSTNAME, A.GENDER, 
  A.LASTNAME, A.LASTNAME_UPPER, A.NAMEPREFIX,
  AD.LICENSE, AD.LICENSE_ALT, AD.LICVALID_FROM, AD.LICVALID_UNTIL, 
  AD.LICVALID_FROM_ALT, AD.LICVALID_UNTIL_ALT 
from ATHLETE A left join ATHLETEDETAIL AD on A.ATHLETEID = AD.ATHLETEDETAILID
my first update statement is (this works):

Code: Select all

update ATHLETE set LASTNAME_UPPER = :PLASTNAME_UPPER where ATHLETEID = :PATHLETEID

my second update statement is (this doesn't work):

Code: Select all

update ATHLETEDETAIL 
set LICVALID_FROM = :PLICVALID_FROM, LICVALID_UNTIL = :PLICVALID_UNTIL
where ATHLETEDETAILID  = :PATHLETEDETAILID
Were there any changes between UniDac 4.x to 5.x that could cause these problems?

cu Christian

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: SQL Server and concurrent select/update

Post by azyk » Wed 07 May 2014 10:49

Hi,

We couldn't reproduce the problem.
To solve the problem, try setting the TUniQuery.SpecificOptions.Values['UniqueRecords'] option to False. If it doesn't help, then please send us a complete small test project to reproduce the problem.

Post Reply