Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Close open transactions in IDE
Message
De
13/04/2015 05:06:58
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01618253
Message ID:
01618281
Vues:
36
>>>If during development, debugging (in VFP IDE) you get error
>>>"Data session ## cannot be released with open transactions" how do you get around it, without having to End the Task in the Task Manager?
>>
>>snippet out of the QUERYUNLOAD of my forms
>>
>> IF .DATASESSION=2 THEN
>>  lnLoop1 = TXNLEVEL()
>>  DO WHILE lnLoop1>0
>>   ROLLBACK
>>   lnLoop1 = lnLoop1-1
>>  ENDDO && lnLoop1>0
>>  lnLoop1 = AUSED(laTables)
>>
>>  FOR lnLoop2 = 1 TO lnLoop1
>>   IF CURSORGETPROP('BUFFERING',laTables(lnLoop2,1))>1 THEN
>>    TABLEREVERT(True,laTables(lnLoop2,1))
>>   ENDIF &&CURSORGETPROP('BUFFERING',laTables(lnLoop2,1))>1
>>  ENDFOR &&lnLoop2
>>*SF 08.09.2003 Close Tables moved to DESTROY
>>*!*	  CLOSE TABLES ALL
>>*  CLOSE ALL EXTENDED
>> ENDIF &&.DATASESSION=2
>>
>>
>>HTH
>
>Thank you. I will try your code.

You may want to wrap it in a loop going through each row returned by asessions(). When you're back in the command window, you are, by default, in session 1. Your unfinished transaction may be in some other session. Not sure if that's necessary for transactions (i.e. if ROLLBACK has to be issued within the same datasession where the BEGIN TRAN was issued), but for tablerevert() it is.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform