Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Private data sessions and transaction
Message
From
13/05/1998 01:39:51
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
12/05/1998 17:43:08
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00098873
Message ID:
00098941
Views:
28
>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
Ç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
Next
Reply
Map
View

Click here to load this message in the networking platform