Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Another datasession anomaly
Versions des environnements
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Virtual environment:
VMWare
HI all,
Hank helped me out with one anomaly last year regarding datasessions and here is another:
- I am using a custom object to work up and print some data
- it is called from a form
- it creates a bunch of cursors and works up data using some of the data from the form's views and some cursors created on the fly
It has always worked but noticed this anomaly when stepping through the code while making some changes:
- the form has a datasessionID of 4
- when the object is instantiated, it has a datasessionid of 3 (which is the DS id of the *parent* form to this form)
- everytime I create a cursor in the object's code, watching SET("Datasession"), it temporarily "flips" to DS #4 and then back to DS #3
What gives? Hank explained last year that if I call prg code from a class that the datasession can change but if a class calls a class, it shares the DS.
Note: it is in a custom object because
a) it was cleaner to code with some methods called over and over and
b) it is only needed rarely on a form so why carry around all the code for the .1% of the time it is needed
The code works but would like to have it all run in the form'd datasession as it makes me nervous that it "flips" around.
Albert
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement