Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Private Data Session Problem

0 views
Skip to first unread message

B&K

unread,
Feb 4, 2000, 3:00:00 AM2/4/00
to
I have a class with "Form" as it's baseclass. I have it set to have a
private data session so any implementation of its methods is in a black
box away from the default data session used on the outside. Inside the
class, I open a database, use tables, run my processes, then cleanup and

close the database. after I release the object, I expect the data
session to vanish, but it remains in the enviroment, along with the
Default data session. This is a drag because as a new object instances
of my class are created, I accumulate data sessions.
How can I get rid of this private data session when I destroy my object?

Thanks in advance
-bku


David Dunetz

unread,
Feb 5, 2000, 3:00:00 AM2/5/00
to
There is a bug with private datasessions and public variables.

If you assign an object reference to a public variable in a method of a form
with a private datasession, the datasession is not released properly when
the form is released.

If you have opened any tables in any methods of the form, the tables are not
closed when the form is released. (Tables opened in the Data Environment of
the form are closed properly.)

You can close the extra open tables by putting CLOSE DATA in the Form.Unload
event. The open datasession will then eventually be re-used by VFP.

David Dunetz
SweetWARE

B&K <b...@ix.netcom.com> wrote in message
news:389BC260...@ix.netcom.com...

B&K

unread,
Feb 5, 2000, 3:00:00 AM2/5/00
to
My problem isnt tables or database containers left open when the object is
detroyed. It's the fact that the enviroment still sees an additional data
session besides "Default".
The real problem with this is that Fox seems to append a new private data
session each time this form object is created, instead of re-using the left-over
one form the previous object instance. I could live with this quirk, except for
the fact that it seems to degrade performance as more private data sessions are
created.

-bku

David Dunetz

unread,
Feb 6, 2000, 3:00:00 AM2/6/00
to
Normal behavior is for the private datasession to be destroyed when the form
is released. The public variable problem I described is a bug. There may be
other, similar problems.

You might consider gradually removing functionality from your form until the
problem goes away, or start with a plain form and gradually add
functionality until the problem occurs. This will at least allow you to
track down the cause.

David Dunetz
SweetWARE

B&K <b...@ix.netcom.com> wrote in message

news:389CF493...@ix.netcom.com...

B&K

unread,
Feb 6, 2000, 3:00:00 AM2/6/00
to
Thanks for the info.

Robert McNeal

unread,
Feb 13, 2000, 3:00:00 AM2/13/00
to
You should make sure that any variables created in this private
datasession are destroyed and that you issue SET DATASESSION TO with no
argument to return to the default datasession. You probably have a
variable hanging around that was created during the Private DS that wont
allow the DS to be released.


0 new messages