Using transactions
makes working with the AutoCAD NET API easier and it is the recommended way
to access objects in the AutoCAD drawing database. There maybe times that you
need to open an object directly but that will be very rare. A transaction
creates a boundary for your code. They allow you to handle errors cleanly and
they operate with a single undo filer. The transaction needs to be committed
to have the changes that your code made to be permanent. If the transaction
is aborted then the changes made in the transaction are rolled back. Another
thing to keep in mind is that transactions can be nested. What this means if
the outer transaction is aborted, then so are the nested transactions even if
they were committed. |