RE: Closing a database

From: Wijck, Bart van <"Wijck,>
Date: Thu, 8 Jul 2004 13:53:56 +0200

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

Rene,

Wow, quick response.

So it's apparently just a question of redundancy.

Agreed that you would want to export as little as needed, although it's only
2 pretty self evident pointers. Now I only export the table pointer but then
have quite a number of
         db := <SybsytemModule>.rt.base;
statements. Also a bit redundant.

Thanks, Bart




-----Original Message-----
From: René A. Krywult [mailto:rene.krywult{([at]})nowhere.xy
Sent: Thursday, July 08, 2004 1:37 PM
To: Wijck, Bart van
Cc: 'blackbox{([at]})nowhere.xy
Subject: Re: Closing a database


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)
-- 
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.
----boundary-LibPST-iamunique-2010596831_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ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pY2ggeW91IGFyZSBzdWJzY3JpYmVk
IHRvIHRoZSBtYWlsaW5nIGxpc3QuIFRoYXQgd2F5LCB0aGUgbGlzdCBzZXJ2ZXIgd2lsbCByZWNv
Z25pemUgeW91IGFzIHN1YnNjcmliZXIgYW5kIGZvcndhcmQgeW91ciBwb3N0aW5nIGltbWVkaWF0
ZWx5LCB3aXRob3V0IGNyZWF0aW5nIGFueSBvdmVyaGVhZC5ccGFyDQpccGFyDQpiKSBJZiwgZm9y
IHNvbWUgcmVhc29uLCB5b3UgY2Fubm90IHBvc3QgZnJvbSB0aGUgYWRkcmVzcywgYnkgd2hpY2gg
eW91IGFyZSBzdWJzY3JpYmVkLCB5b3VyIG1lc3NhZ2Ugd2lsbCBiZSBtb2RlcmF0ZWQgdG8gYXZv
aWQgc3BhbS4gUGxlYXNlIHVuZGVyc3RhbmQgdGhhdCBtb2RlcmF0aW9uIHdpbGwgb2Z0ZW4gY2F1
c2Ugc29tZSBkZWxheSwgaW4gcGFydGljdWxhciBvdmVyIHdlZWtlbmRzIG9yIGhvbHlkYXlzLlxw
YXINCn0
----boundary-LibPST-iamunique-2010596831_-_---
Received on Thu Jul 08 2004 - 13:53:56 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:41 UTC