FetchAll=False and Locks - Problem
Posted: Thu 08 Jan 2009 10:36
Hi,
i have this problem, maybe i did'nt understand the FetchAll - Idea as well.
Situation:
A table i.g. Customers with up to 100.000 Records, additional up to 20 related tables in master-detail relation to this maintable.
Form[1]:
Based on the query SELECT * FROM Customers WHERE ID = [one id] it shows one record with all relations. First i open the query on base table, after that i open the details tables.
It works fine and quick.
All tables are FetchAll = True, editing data works well.
Form[2]:
Only a crDBGrid + Datasource + MSQuery with SELECT [some fields] FROM Customers.
MSQuery.Fetchall=false, MSQuery.Readonly=true,
MSQuery.Cursortype=ctDefaultResultSet (because of enabling local sorting)
My Idea is: first search with form[2] one record, than show detail data by calling form[1]. If i single user, it works fine.
But in Multi -User enviorment my Problem is:
The Form[2] (with the fetchall=false - query) locks records. Depending on sorting in the crdbgrid there are sometimes many, many locks at the DB - Tables. These locks prevent other users from changing data.
But i dont want any locking while searching with my Form[2].
How can i configure SDAC, that there are no locks when fetchall=false ?
Thanks
Tino
Edit:
Latest SDAC,
MSSQL Server 2000
Delphi 2006
i have this problem, maybe i did'nt understand the FetchAll - Idea as well.
Situation:
A table i.g. Customers with up to 100.000 Records, additional up to 20 related tables in master-detail relation to this maintable.
Form[1]:
Based on the query SELECT * FROM Customers WHERE ID = [one id] it shows one record with all relations. First i open the query on base table, after that i open the details tables.
It works fine and quick.
All tables are FetchAll = True, editing data works well.
Form[2]:
Only a crDBGrid + Datasource + MSQuery with SELECT [some fields] FROM Customers.
MSQuery.Fetchall=false, MSQuery.Readonly=true,
MSQuery.Cursortype=ctDefaultResultSet (because of enabling local sorting)
My Idea is: first search with form[2] one record, than show detail data by calling form[1]. If i single user, it works fine.
But in Multi -User enviorment my Problem is:
The Form[2] (with the fetchall=false - query) locks records. Depending on sorting in the crdbgrid there are sometimes many, many locks at the DB - Tables. These locks prevent other users from changing data.
But i dont want any locking while searching with my Form[2].
How can i configure SDAC, that there are no locks when fetchall=false ?
Thanks
Tino
Edit:
Latest SDAC,
MSSQL Server 2000
Delphi 2006