English

How To: Do nested transactions with SDE in MapObjects 2.0

Procedure

Summary

True nested transactions are not possible. MapObjects 2 cannot StartTransaction inside another transaction. However, it is possible to perform multiple updates (or CancelUpdates) within a single transaction.

Procedure

This example illustrates how to do multiple updates within a single transaction:

Code:
Set recs = MySDELayer.Records
recs.StartTransaction
While not recs.EOF
recs.Edit
recs.Fields.Item("Shape).value = newShp
or
recs.Fields.Item("attributename").Value = newValue
recs.Update
or
recs.CancelUpdate
recs.MoveNext
Loop

recordset.CommitTransaction
or
recordset.RollbackTransaction