Abaksoft Posted February 1, 2016 Posted February 1, 2016 Hello Friends, I want to confirm this : When you create an Object wich pilot a long CRUD transaction : My_Object:=TMyClass.Create Try //************ //1. Sending properties My_Object.F1:=xxx; My_Object.F2:=yyy; ... //2. Executing Methods My_Object.DoSomething; //*********** Finally My_Object.Free end; DoSomething is a long SQL transaction (3-10 sec). Without DCallBack messages ! In my tests (local Desktop) all is OK (Unigui 1260); and My_Object is Free after my long transaction ends. This is a correct behavior (as VCL) And very important, otherwise, DoSomething could'nt work properly. What i want to confirm : is there a risk, on a VPS in hight production, that my object Free before ending transaction ? (Manipulating threads ?!) Farshad; For beautiful code, I don't want to Create it on Form.Create and Free it on Destroy Form. Related Topic : http://forums.unigui.com/index.php?/topic/5559-houstonwe-have-a-problem/&do=findComment&comment=28426 Thank you... Quote
zilav Posted February 3, 2016 Posted February 3, 2016 "Finally" section will be always executed, so don't worry. However you might consider changing to use DB stored procedures in such cases, it is a better practice. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.