Puzzle: ToraSession and MultThread

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
odacACTOR
Posts: 1
Joined: Thu 19 Jan 2006 07:51

Puzzle: ToraSession and MultThread

Post by odacACTOR » Thu 19 Jan 2006 08:26

Application has a ToraSession and several MultThread.

Application.mainform.create:
begin
GameDb.Server := '127.0.0.1';
GameDb.Username := 'test';
GameDb.Password := '1';
GameDb.Options.Net := false;
GameDb.ThreadSafety := True;
GameDb.Open;
end;

MultThread.execute :
var
query:ToraQuery;
NowName,id :string;
begin
//.........Get values
NowName:='vkes';
id :='a123';
//.........
try
Query := Toraquery.create(nil);
try
Query.Session := GameDB;
Query.sql.Text := 'update userb set name=' + quotedstr(NowName)+' where ID= ' + quotedstr(id);
adoQuery.execute;
finally
FreeAndNil(query);
end;
except
//.............deal errors
//..............
end;
end;

Puzzle: Does ToraSession need critical directive symbol when MultThread execute SQL.[/quote]

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 20 Jan 2006 15:53

No, you don't need any additional synchronization. For more infromation refer to Thread demo. If you have any problems please send us complete demo project that demonstrates your problem.

Post Reply