Subject Re: Lost connection to firebird after execute procedure
Author wojciech_materna
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
> At 11:53 PM 4/12/2004 +0000, you wrote:
>
> > > When you say "execute stored procedure", what do you mean?
> > > a) is it an executable stored procedure that returns a single
row
> >of
> > > results following an EXECUTE PROCEDURE call?
> > > or
> > > b) is it a selectable stored procedure that includes a FOR
> > > SELECT...INTO...DO...SUSPEND loop that returns a multi-row set
> >upon a
> > > SELECT <output list> FROM ... call?
> > >
> > > Or is it a SP that actually changes some data and also returns
a
> >multi-row
> > > set?
> > >
> >
> >It is procedure FOR SELECT ........ SUSPEND, only shows data
without
> >any update or insert. But takes data from second procedure and
some
> >tables.
>
> This is not clear. Didn't you say that, if one instance of the
procedure
> was running in one window, another instance of the same procedure
would
> refuse to run in the second window, and return the bad block error?
>

It is one window - creating once, showing, then closed, released.
Next open the same next time with same selects - and I heave errors.
The same things happens, when I open (create) that window 2 times
without closing first.


> > > -- The first is that on Firebird 1.0 you have some condition
where
> >a
> > > running SP blocks another transaction from running the same SP
and
> > > apparently returns an error related to a bad block (parameter?
> > > transaction?). Does it occur at Prepare time or at run-time?
I
> >would want
> > > to enable an ib_monitordialog in the application, to see what
is
> >being
> > > passed to and from the server when this error occurs.
> > >
> >
> >At run-time. I don't know about this conditions,sorry. Can You
tell
> >me few words about it?
>
> Presumably, before you run the stored procedure, your code checks
to
> determine whether the statement is prepared:
>
> with MySPDataset do begin
> if not Prepared then Prepare;
>
> >I will try to observe in monitordialog what
> >exactly is being passed to and from server.
>
> The monitor will show you the contents of the parameter block that
is
> passed to the server at Prepare time; and it will subsequently
show you
> the values that are passed in the parameters when the statement is
executed.
>
When everything goes well (first time) monitor shows:

PREPARE STATEMENT
TR_HANDLE = 34942824
STMT_HANDLE = 34832592

select n.konto,o.nazwa nazwa,sum(n.kwota_wn) naleznosc,max
(n.opoznienie) opoznienie,min(n.opoznienie) opozmin,avg
(n.opoznienie) opozsr,count(*) ile,sum(n.jesto) ileo,sum(n.jestz)
ileoz, sum(n.kwota_wno) nalopoz,sum(n.kwota_wnz) nalopozz from
OBR_NRK('101,201 0000000044 ,201 00667 ,201
0987654321 ,201 100 ,201 5260210429 ,201 6840019862,201
5272098665,201 8133196354',0,0) n , odbdosraz o where
o.konto=n.konto and n.konto starting with '201' and n.znak=1 group
by n.konto,o.nazwa
ORDER BY 2 ASC

FIELDS = [ Version 1 SQLd 11 SQLn 44
KONTO = <NIL>
[NAZWA] = <NIL>
[NALEZNOSC] = <NIL>
[OPOZNIENIE] = <NIL>
[OPOZMIN] = <NIL>
[OPOZSR] = <NIL>
[ILE] = <NIL>
[ILEO] = <NIL>
[ILEOZ] = <NIL>
[NALOPOZ] = <NIL>
[NALOPOZZ] = <NIL> ]

SECONDS = 0.020
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 34942824
STMT_HANDLE = 34832592
PARAMS = [ ]

SELECT COUNT: 4216

SECONDS = 3.345


OBR_NRK and ODBDOSRAZ are stored procedures reading data from
tables, nothing changes, inserts - just select.

Second try to open same query gives me :

PREPARE STATEMENT
TR_HANDLE = 34832852
STMT_HANDLE = 34942616

select n.konto,o.nazwa nazwa,sum(n.kwota_wn) naleznosc,max
(n.opoznienie) opoznienie,min(n.opoznienie) opozmin,avg
(n.opoznienie) opozsr,count(*) ile,sum(n.jesto) ileo,sum(n.jestz)
ileoz, sum(n.kwota_wno) nalopoz,sum(n.kwota_wnz) nalopozz from
OBR_NRK('101,201 0000000044 ,201 00667 ,201
0987654321 ,201 100 ,201 5260210429 ,201 6840019862,201
5272098665,201 8133196354',0,0) n , odbdosraz o where
o.konto=n.konto and n.konto starting with '201' and n.znak=1 group
by n.konto,o.nazwa
ORDER BY 2 ASC

FIELDS = [ Version 1 SQLd 11 SQLn 44
KONTO = <NIL>
[NAZWA] = <NIL>
[NALEZNOSC] = <NIL>
[OPOZNIENIE] = <NIL>
[OPOZMIN] = <NIL>
[OPOZSR] = <NIL>
[ILE] = <NIL>
[ILEO] = <NIL>
[ILEOZ] = <NIL>
[NALOPOZ] = <NIL>
[NALOPOZZ] = <NIL> ]
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 34832852
STMT_HANDLE = 34942616
PARAMS = [ ]

SECONDS = 0.561

ERRCODE = 335544721
----*/
/*---
INTERPRETE BUFFER =

ERRCODE = 53
----*/
/*---
INTERPRETE BUFFER = Unable to complete network request to host "top-
sql".

ERRCODE = 39
----*/
/*---
INTERPRETE BUFFER = Error reading data from the connection.

ERRCODE = -1



> Now, assuming that all of your client machines have gds32.dll and
are
> loading it from %system%, you must ensure that each client machine
has the
> correct version of gds32.dll. The same thing applies, even if you
are
> running Fb 1.0 -- where you are seeing your first problem. Make
sure that
> the client machines have the correct gds32.dll for the version of
the Fb
> server that they are connecting to. An old gds32.dll from IB 6,
or IB 5.x,
> or from an older Fb 1.0 beta, will not do.

Of course, I deleted previous version completelly and install FB
once again.

>
> ./hb

Thank You very much. It is always great to read Your answers on this
group. Maybe You can tell me something helpfull after my post?

Wojtek