Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to determine if a transaction is still pending in SQ
Message
De
01/05/2007 13:40:13
 
 
À
01/05/2007 13:38:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01221475
Message ID:
01221585
Vues:
11
Thanks!

>Yes.
>
>>Does @@trancount work with SQLServer 2000?
>>
>>
>>>It seems to me very unreliable. You can certainly send COMMIT with error trap to see if transaction still open, but I feel it's wrong approach. What is going to happen if you client just crashes?
>>>I would use remote view/cursor adapter and table buffering for this situation.
>>>
>>>>I agree, but in this case, a begin is sent as soon as a change is made to a field on a form. There is a grid displaying a small result set and they want all edits to be within one single transaction to roll them all back if necessary. That part is working fine. The code to rollback or commit is in the form's queryunload method so if the form is exited by the button or the X, it rollsback the transaction or commits it. A form property is set to true when the BEGIN TRANSACTION is sent to the server successfully when the first (whichever it is) field is edited. I just want to check after the form is closed (or before it is destroyed) to see if there is a transaction pending in a more reliable means communicating with SQL Server rather than using the form property.
>>>>
>>>>
>>>>
>>>>>>Connecting to SQLServer 2005, if a BEGIN TRANSACTION is sent to SQLServer, what is the safest way to determine if a ROLLBACK or COMMIT were or were not sent to end the transaction? If you send a COMMIT or ROLLBACK and no transaction is pending, you receive the SQL error...
>>>>>
>>>>>Imho, you shouldn't send them separately, i.e. you better call SP that contains both BEGIN and COMMIT.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform