Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form's datasession is not released
Message
 
 
To
29/03/2002 17:12:00
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00639028
Message ID:
00639200
Views:
25
>>Hi everybody,
>>
>>This is in my colleague's application: there is a class called Update, which is instantiated in the main program of the application.
>>
>>Here is the top of its Init method:
>>
>>LPARAMETER tcDBC
>>*--- This is the initialization method for this class ...
>>
>>*--- DNG 5/9/2000: Store database to object property.
>>*--- NOTE: All update related functions should reference oupdate.curdbc instead of ojc.curdbc.
>>*----------01/29/02 add these settings here:
>>SET DELE ON
>>SET TALK OFF
>>SET SAFETY OFF
>>SET EXACT ON
>>THIS.curdbc = m.tcDBC
>>*--- Start statistics form.
>>PUBLIC oMatchStats
>>DO FORM matchstats NAME oMatchStats LINKED NOSHOW
>>SET DATASESSION TO oMatchStats.DATASESSIONID
>>THIS.pDataSession = oMatchStats.DATASESSIONID
>>*--- DNG 6/28/2001: Default pnpostdatasession.
>>THIS.pnPostDataSession = THIS.pDataSession
>>
>>SET MULTILOCKS ON	&& For buffering for this new datasession.
>>
>>Here is Destroy method of this class:
>>IF VARTYPE(opost) = "O"
>>   release opost
>>endif
>>close databases all
>>*!*	=closeallbasetables(SET('DATASESSION'))
>>*!*	if used('postcursor')
>>*!*	use in postcursor
>>*!*	endif
>>*!*	if used('matchedprops')
>>*!*	use in matchedprops
>>*!*	endif
>>*!*	if used('ltstatstemp')
>>*!*	use in ltstatstemp
>>*!*	endif
>>*!*	if used('towns')
>>*!*	use in towns
>>*!*	endif
>>*!*	omatchstats.release()
>>*!*	omatchstats=null
>>*!*	release omatchstats
>>
>>dodefault()
>>
>>The matchstats form has no code at all and it has couple of textboxes with
>>oUpdate.Someproperty as a controlsource...
>>
>>When the application is finished, it still has "Unknown(2)" session, which is empty.
>>
>>Can you see, what could be the problem here and why this DS remains opened?
>>
>>Thanks in advance.
>
>Nadya,
>
>The init makes a public variable oMatchStats
>then in the init: DO FORM matchstats NAME oMatchStats LINKED NOSHOW
>
>If you add: Release oMatchStats to the Destroy of the class it will work (or uncomment the last commented line in the Destroy method)

We tried it, but it didn't work. The session is still alive.

However, I got one idea on the way home. Why at all we need a separate custom Update class calling this form by this way. Why the form itself could not be an Update class. We can make it invisible for several parameters... It seems, like a good and simple approach to me, but I haven't decided yet, would I code it myself and give her the final result or just give this idea to her to code...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform