Subject Re: [IBO] Passive mode
Author consultor_cys

I don't know if it's a bug or not, but TIB_Script.Executing was
getting stuck on TRUE, and when I tried to use TIB_Script again I got
the error message that, after taking a look at your source code, now I
understand: "Executing already or not in Passive mode" - means exactly
what it means: "TIB_Script is already executing or it is not in
Passive mode"!

Do You think it could be getting stuck because of my 'ugly' Commit?

Here's a snippet of what solved my problem:

procedure TDM.LimpaTabelas;
if (SplashForm <> NIL) and SplashForm.Showing then begin
SplashForm.ShowMessage('Limpando tabelas...');

dscScript.SQL.Text := 'update Visitante ....'; /// a valid script

SaveSQLToFile('LimpaTabelas', LoginForm.pUSERCODE, dscScript.SQL);

/// -------------- I ADDED THESE LINES
while dscScript.Executing do begin
/// Will wait forever?
/// I have to do something here to avoid an endless loop
/// -----------------------------------

on E: Exception do LogError('DM.LimpaTabelas EXCEPTION: '+E.Message);

--- In, Helen Borrie <helebor@t...> wrote:
> At 08:40 PM 10/03/2005 +0000, Antonio Carlos Ribeiro wrote:
> >Someone could tell me what's the meaning of "Executing already or not
> >in Passive mode".
> >
> >This error occurs only when I execute a TIB_Script connected to a
> >FirebirdSQL using a WAN (768k down/256k up dsl line) connection.
> It means that the ib_script is currently executing and is waiting
for the
> client to tell it that it has finished executing.
> >I primarily use IBO* components that are doing fine...
> >
> >My english isn't exactly good, but does it need to be in "Passive
> >mode" **or not**?
> Passive mode is available to TIB_Process classes (of which
TIB_Script is
> one). When set True, it allows the process to be set up so that it can
> continue to retry executing, e.g. in idle CPU time, without stalling
> application.
> >And what's a "Passive mode" exactly? I use PASSV in ftp connections,
> >but never saw it in databases.
> It's not a database attribute, but a process attribute.
> A TIB_Script has this property set to False. I think it needs to be
> in this state; otherwise (as far as I can tell) you would never know
> whether the script's execution completed or not. What you really
want is
> for the application to be in control of the statement-by-statement
> execution of the script - trap exceptions, handle time-outs, and so
on, and
> finally confirm that execution completed successfully.
> I haven't had the experience of executing a script across a slow
> connection, to know how to deal with disconnection, time-outs or dirty
> packets, though I suspect that this could be the source of the
problem. Or
> perhaps your application is simply attempting to re-execute the script
> while the process is still active...
> Don't take this as a final answer: hopefully Jason will spot it and
> more light on it.
> Helen