Locks problem using SQL Server 2000
From: JogyRoger (jj_at_jj.com)
Date: 02/22/04
- Next message: Richard Bibby: "Re: Importing the type library"
- Previous message: Oktay Sancak \(ceoworks\): "Re: Date field problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 22 Feb 2004 18:55:21 +0200
I have a locking problem when using SQL Server with ADO. I use one
connection to access a specific database, to select data from it and update
insert data in it. The connection's properties are these:
object Conn: TADOConnection
CommandTimeout = 2000
CursorLocation = clUseServer
IsolationLevel = ilReadUncommitted
LoginPrompt = False
Provider = 'SQLOLEDB.1'
end
So the problem happens at point of the process where i'm selecting data
from one or two tables , then scroll the dataset and update the data. Here
it is the function that creates dynamically the dataset that i use:
res := TADODataSet.Create(nil);
res.CommandTimeout := CmdTimeout;
res.CursorLocation := clUseServer;
res.CursorType := ctOpenForwardOnly;
res.ExecuteOptions := [];
res.LockType := ltReadOnly;
res.CacheSize := ADOCacheSize;
res.Connection := conn; //This is set to Conn
Result := res;
and the definition of the command that i use for the updates:
CommandTimeout = 2000
Connection = Conn
ExecuteOptions = [eoExecuteNoRecords]
Parameters = <>
So i have the open dataset and when the first update statement executes i
get Timeout expired after a long time (i've set commandtimout to a big
number). If i try to repeat only this procedure again and again the result
is the same even if i close and start the application again. But if i
restart the SQL Server the procedure works without any problems. Any
suggestions what to do? I fixed the same problem for another procedures as i
got all the UPDATES statements in a StringList and posted them after i
closed the dataset which i used to generate them. However in this case there
are too many rows to update and i cannot store all updates in the memory....
JogyRoger
- Next message: Richard Bibby: "Re: Importing the type library"
- Previous message: Oktay Sancak \(ceoworks\): "Re: Date field problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|