multithreading - Delphi 5 + BDE + TStoredProc + Oacle + Thread -
i'm trying develop application runs stored procedure in background mode.
1 - if run in mains thread, it's ok, it's lock screen.
2 - if put stpgen.execproc; in thread, it's runs ok, it's lock mains thread too.
is there option run tstoredproc in thread , don't lock main thread?
code:
type tstoredprocsegundoplano = class(tthread) private stpgen: tstoredproc; excerro: exception; protected procedure execute; override; public constructor create(const stpgen: tstoredproc; const blnautofree, blnautostart: boolean); property erro: exception read excerro; end; implementation { tstoredprocsegundoplano } constructor tstoredprocsegundoplano.create(const stpgen: tstoredproc; const blnautofree, blnautostart: boolean); begin inherited create(true); self.excerro := nil; self.stpgen := stpgen; if blnautofree freeonterminate := true; if blnautostart resume; end; procedure tstoredprocsegundoplano.execute; begin try try stpgen.execproc; except on e: exception begin excerro := acquireexceptionobject; end; end; terminate; end; end;
so, call way:
tstoredprocsegundoplano.create(stpgen, true, true);
in moment, application ok, few seconds after, maisn threads lock, don't have idea know resolve this, it's possivel run tstoredproc un background?
thanks
Comments
Post a Comment