Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lingering DataSession
Message
De
14/05/1999 19:48:36
 
 
À
14/05/1999 14:34:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00219158
Message ID:
00219276
Vues:
19
Hi Tom,

DataSessions and DataSessionIDs are a pain in the ass.

First, make sure that the released form is actually released - use the debugger and check out the _SCREEN.Forms collection.

Assuming you are using a form as your SQLObject, try setting the DataSession to 2 (private) and establish the Oracle connection in the Load Event. Here you can also create cursors and add them to the DataEnvironment, set DataEnvironment and Cursor properties, etc.

When you fire off a form, set the the form's DataSessionID to the DataSessionID of the SQLObject in the form's Load Event. Remember that you can't do this by passing a parameter to the form's Init since the Load Event occurs before Init.

After the form is destroyed, the SQLObject is still available for other forms, reports, toolbars, etc.

Note: Beware of toolbars (or any other forms) with different DataSessions being refeshed via a timer. Unless they are in sync with the active form, you could find yourself in another DataSession.

Hope this helps.


>I have a problem with a lingering datasession. The default
>datasession is level 1 and the private datasession is level 2
>but level 2 does not go away after the form completes.
>
>I am using VFP 6 and under the default datasession I am
>instantiating a SQLConnect object to Oracle. Once an
>event occurs, I kick off a form with a private data session
>(session 2) that I would like to use the already active
>SQLObject. In order to return the data to the correct
>datasession (session 2) I passed in the calling form's
>datasessionid to the SQLObject.
>
>The problem is that the private data session (level 2) is
>still around after the form closes. Why? I thought if
>I simply copy the form.datasessionid to a VFP variable and
>just passed it that there would not be any lingering
>reference.
>
>I would expect for datasession level 2 to close itself once
>the form with the same datasession is no longer active. Any
>ideas on how to rectify this situation? I want the SQLObject
>to instantiate in the main program because it is slow to
>bring up and should be available to other forms that need it...
- Jeff
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform