Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is this transaction sequence valid?
Message
From
19/12/2005 16:29:15
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Is this transaction sequence valid?
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01079337
Message ID:
01079337
Views:
48
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.
Next
Reply
Map
View

Click here to load this message in the networking platform