Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this transaction sequence valid?
Message
De
19/12/2005 16:29:15
Randy Witt
Diamond Vogel Paints
Orange City, Iowa, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Is this transaction sequence valid?
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01079337
Message ID:
01079337
Vues:
47
Simplified, what I'm trying to do is similar to this:
*  Code in controlling object:
lFlag = .T.
BEGIN TRANSACTION
FOR EACH oObject IN colObjects

   *  This next block of code is actually contained within each oObject,
   *  it's not directly within the controlling object:
   BEGIN TRANSACTION
   SELECT oObject.cCursor
   *  Make some sort of changes to the cursor
   IF TABLEUPDATE(oObject.cCursor)
      END TRANSACTION
      RETURN .T.
   ELSE
      ROLLBACK
      RETURN .F.
   ENDIF
   *  End of internal block of code

   IF NOT lFlag      &&  Returned T/F from internal block of code
      EXIT
   ENDIF
ENDFOR

IF lFlag
   END TRANSACTION
ELSE
   ROLLBACK
ENDIF
In essence, I am trying to update a series of cursors contained within a collection of objects, externally from a different controlling object. The objects in the collection aren't aware of the controlling object. I was hoping to be able to "undo" all of the changes, if any of the updates of the collection objects fails. Will this work?

Thanks,
Randy W.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform