isql leaks requests?

16 views
Skip to first unread message

Dimitry Sibiryakov

unread,
Dec 13, 2022, 10:52:09 AM12/13/22
to Firebird Developers List
Hello All,

in ISQL code I see quite a few calls to compileRequest() but no calls to
IRequest->free(). How is it supposed to work?

--
WBR, SD.

Alex Peshkoff

unread,
Dec 14, 2022, 3:55:46 AM12/14/22
to firebir...@googlegroups.com
All are gpre-generated, yes?
Stored in static variables  - like:

static Firebird::IRequest*
   fb_1121 = 0;     /* request handle */

Released after attaching another database:

if (fbStatus->getErrors()[1] == isc_bad_req_handle) {
fb_1121->release(); fb_1121 = NULL; }

Or when exiting isql.


Dimitry Sibiryakov

unread,
Dec 14, 2022, 7:02:25 AM12/14/22
to firebir...@googlegroups.com
'Alex Peshkoff' via firebird-devel wrote 14.12.2022 9:55:
> Released after attaching another database:
>
> if (fbStatus->getErrors()[1] == isc_bad_req_handle) { fb_1121->release();
> fb_1121 = NULL; }
>
> Or when exiting isql.

It means that result set and locks are kept indefinitely. Such a waste of
resources...

--
WBR, SD.

Alex Peshkoff

unread,
Dec 14, 2022, 8:24:22 AM12/14/22
to firebir...@googlegroups.com
That's how it used to work since at least IB6.0.1.
Agree that with server-side statements cache it has absolutely no sense.


Dimitry Sibiryakov

unread,
Dec 14, 2022, 8:32:51 AM12/14/22
to firebir...@googlegroups.com
'Alex Peshkoff' via firebird-devel wrote 14.12.2022 14:24:
>>   It means that result set and locks are kept indefinitely. Such a waste of
>> resources...
>>
>
> That's how it used to work since at least IB6.0.1.
> Agree that with server-side statements cache it has absolutely no sense.

It also could explain garbage temporary files that gathering in temp
directories: without proper release there is no execution point where they can
be deleted.

--
WBR, SD.

Dimitry Sibiryakov

unread,
Dec 22, 2022, 3:30:05 PM12/22/22
to firebir...@googlegroups.com
'Alex Peshkoff' via firebird-devel wrote 14.12.2022 14:24:
> That's how it used to work since at least IB6.0.1.

BTW, is it normal that single "SHOW TABLE T" in isql allocates 13 requests or
should I look for a bug somewhere at my side?

--
WBR, SD.

Alex Peshkoff

unread,
Dec 23, 2022, 3:45:29 AM12/23/22
to firebir...@googlegroups.com
Depends upon table. If it has various constraints - 13 is ok.


Adriano dos Santos Fernandes

unread,
Dec 23, 2022, 5:28:05 AM12/23/22
to firebir...@googlegroups.com
One of reasons that I like Oracle approach where metadata extraction is
done through a server-side reusable package (DBMS_METADATA).


Adriano

Reply all
Reply to author
Forward
0 new messages