Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private data sessions and transaction
Message
From
15/05/1998 01:51:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
14/05/1998 13:59:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00098873
Message ID:
00099663
Views:
25
>>>Greetings again comrades -
>>>
>>>Background: I have a private data session in my form, but shockingly enough <g> have bombed out a few times in the middle of something. I'd tried to cancel the debugger, cancel the form, and fix the problem. Sometimes I could and sometimes I couldn't (many attempts at clear all, close all). It seems I'd often end up with several data sessions and sometimes Unknown data session .
>>>
>>>Today after one such episode I found that I got a "Data mismatch error" when trying to do an append in a form which had previously worked. After attempting to look at the database I got a message to the effect that this wasn't permitted in the middle of a transaction. It finally dawned on me that some of those datasessions were in the middle of transactions, and I had to go to them and do a rollback to set things right.
>>>
>>>So here are my questions: 1) How do you close out a private data session when this happens (i.e. is there another way besides what I did)? 2) Since it was a private data session, I don't understand why I'd get that message about transactions unless I was in that data session when I tried that maneuver. 3) Is Transaction not scoped (if that's the correct phrase) to the private datasession?
>>>
>>>Thank you for any information you can provide,
>>>
>>>Sylvia
>>Sylvia,
>>Transactions are not *scoped* to current data session. It's like a read...clear read. In other words, you could "begin transaction" from command line and "end transaction" or "rollback" after running a lot of code. Where stucked do a rollback. But for the moment I would suggest to keep the transaction in a method where much code is not called. Think this scenario :
Begin transaction
>>* Some code here
>>* Error occurs and you cancel to fix
>>* In second pass again error is not fixed and you cancel again
>>* Another level of transaction has begun
>>* Now the error is fixed but "end transaction" only ends the last one (3rd).
Cetin
>
>Cetin -
>
>Thanks once again. If I understand you correctly, I should just type rollback until I can't rollback no more, no more;) (this is bad grammar, but a pun on an American song whose name I can't remember) But how do I get rid of all these data session hanging around (or perhaps what you're saying is clean up after each session and I won't have this trouble?)
>
>Sylvia
>
>P.S. Unrelated side note - I've been watching a program about Alexander the Great and they showed Turkey (as one of the many countries he mowed through). You have some pretty scenery!
Yes no more, no more as in the song (a pretty song) until txnlevel() = 0. Transactions can be nested down to 5 levels and txnlevel() returns the level of transaction (sounds they borrowed something from read). During development what I do is to do a series of rollback until I got that "No trans.." message. For now I would suggest using dataenvironments and calling DE.closetables. During development when an error occurs, suspend and select fix from debugger\debug. This generally cleanup all then rollback(s).
PS: Hope they didn't hang in Istanbul as usual and showed the really lovely places especially in north, west and south shorelines.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform