Re: Closing a database

From: René A. Krywult <"René>
Date: Thu, 08 Jul 2004 13:36:51 +0200 (DFT)

----boundary-LibPST-iamunique-294751135_-_-
Content-type: text/plain

As I see it, you would not want to export more than is necessary. You would not want to export any redundant (=unnecessary) information.

An interface is more clear, the less elements it contains. Everything that is not necessary to be visible, should be opaque.

Further, what is the benefit of having the db variable globally? Is manual deconstruction a benefit? Is it a benefit to have to manually deconstruct the table AND the database?

Rene

=============René A. Krywult
-------------------------------------------------
"Gûrberen," pent i naneth dî,
"mabapadan a ce darach sí!"
___________________________________



----- Original von: "Wijck, Bart van" <Bart.van.Wijck{([at]})nowhere.xy

> Hi BlackBox people,

Can anyone answer the following question:

As long as you are processing a database with SQL you need database and
table objects. When you are done processing you set these object pointers to
NIL. With the explicit command Kernel.Cleanup the garbage collector closes
the database, or I presume this happens anyway when you are finish executing
altogether. The point obviously is not to keep the database open longer than
necessary.

What I do not understand why BlackBox advises to make the database pointer a
local variable and only export the table pointer. Yes you can at anytime
recreate the database pointer form the table pointer via:

        db := <sybsytem>.rt.base; (* where rt is the result table
pointer *)

But what is the big difference? The presumably large chunk of memory where
the database object is allocated is retained in any case until all (!)
references to it are set to NIL. So even if db is local and presumably set
to NIL automatically when the procedure in which it is defined has finished
executing, there's still the reference to it in rt.base (which is global and
exported).
Closing the database still needs to be done explicitly by setting rt := NIL.

So why not export both objects and set them to NIL when needed?

Regards, Bart






-- 
The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it. 
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xyTo get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xyCurrent posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
-------------------------------------------
Versendet durch AonWebmail (webmail.aon.at)
--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xyTo get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xyCurrent posting policy:
a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.
b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.
----boundary-LibPST-iamunique-294751135_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBBcyBJIHNlZSBpdCwgeW91IHdv
dWxkIG5vdCB3YW50IHRvIGV4cG9ydCBtb3JlIHRoYW4gaXMgbmVjZXNzYXJ5LiBZb3Ugd291bGQg
bm90IHdhbnQgdG8gZXhwb3J0IGFueSByZWR1bmRhbnQgICg9dW5uZWNlc3NhcnkpIGluZm9ybWF0
aW9uLiBccGFyDQpccGFyDQpBbiBpbnRlcmZhY2UgaXMg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