Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this transaction sequence valid?
Message
De
19/12/2005 17:01:26
Randy Witt
Diamond Vogel Paints
Orange City, Iowa, États-Unis
 
 
À
19/12/2005 16:41:44
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
Database:
Visual FoxPro
Divers
Thread ID:
01079337
Message ID:
01079351
Vues:
14
Thanks for the response. Maybe this is a more accurate code sketch of what I'm doing:
*  Controlling object
lFlag = .T.
BEGIN TRANSACTION
FOR EACH oObject IN colObjects
   IF NOT oObject.SaveChanges()
      lFlag = .F.
      EXIT
   ENDIF
ENDFOR

IF lFlag
   END TRANSACTION
ELSE
   ROLLBACK
ENDIF

*  Simplified internal object (oObject) code, method "SaveChanges":
*  There are BEGIN TRANSACTION, END TRANSACTION & ROLLBACK steps
*  in this method b/c this internal object already exists separately,
*  it doesn't know it's being called by the external object.
BEGIN TRANSACTION
SELECT THIS.cCursor
*  Make some changes
IF TABLEUPDATE(THIS.cCursor)
   END TRANSACTION
   RETURN .T.
ELSE
   ROLLBACK
   RETURN .F.
ENDIF
I can't modify the method I've called "SaveChanges", that already exists; I can only attempt to wrap it with my "controlling" or external object. Can this be done?

Thanks again,
Randy W.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform