Transactions
§Transactions
§Sets the boundary for database operations
§Handles exception cleanly
§Operates with a single Undo filer
§
§Can be
committed – All database operations are saved
rolled back – All database operations are aborted
§
§Can be nested
If outer transaction is aborted inner transactions are aborted too
§
§
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.