Page 1 of 1

Puzzle: ToraSession and MultThread

Posted: Thu 19 Jan 2006 08:26
by odacACTOR
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]

Posted: Fri 20 Jan 2006 15:53
by Challenger
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.