Ver Mensaje Individual
  #1  
Antiguo 14-10-2010
b1ast3r b1ast3r is offline
Registrado
 
Registrado: feb 2008
Posts: 7
Reputación: 0
b1ast3r Va por buen camino
Servidor me desconecta

Servidor Ubuntu con Mysql 5.
Delphi 7

en un For
mando llamar un Thread y este thread manda hacer un update a la base de datos.

Pero como hace tantos update tan rapido, termina el programa por que el servidor me desconecta.

Ahora soluciono con un sleep(600) pero es mucho tiempo.

Alguna sugerencia ?

Uso el TZQuery para hacer el update

Cita:
procedure TForm1.Button1Click(Sender: TObject);
var x:integer;
begin
x:= 0;
while (x<=10000) do
begin
if(memo1.Lines.Strings[x] = '') then
begin
x:=10001;
end
else
begin
sleep(100);
ZQuery1.SQL.Clear;
ZQuery1.SQL.Add(memo1.Lines.Strings[x]);
Run(ZQuery1);
x:=x+1;
end;
end;
end;


procedure TQueryThread.Execute;
begin
Query.ExecSQL;
end;

Última edición por b1ast3r fecha: 14-10-2010 a las 22:10:32.
Responder Con Cita