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

Click here to load this message in the networking platform