TheSwamp

Code Red => .NET => Topic started by: kdub_nz on February 14, 2023, 05:37:56 PM

Title: StartOpenCloseTransaction vs StartTransaction?
Post by: kdub_nz on February 14, 2023, 05:37:56 PM
StartOpenCloseTransaction vs StartTransaction?
Trying to wrap my head around use cases . . .

This seems to be one of the better descriptions of the differences.
Thanks ( again ) Tony

https://forums.autodesk.com/t5/net/difference-between-startopenclosetransaction-vs-starttransaction/td-p/7290717

Regards,
Title: Re: StartOpenCloseTransaction vs StartTransaction?
Post by: kdub_nz on February 14, 2023, 05:48:17 PM
And of course there are these classics :

( from about 10 years ago )
https://www.theswamp.org/index.php?topic=42399.0
and
https://adndevblog.typepad.com/autocad/2012/08/the-right-tools-for-the-job-autocad-part-5.html

Title: Re: StartOpenCloseTransaction vs StartTransaction?
Post by: It's Alive! on February 14, 2023, 06:20:42 PM
I view StartOpenCloseTransaction as a container that disposes each item when calling commit or abort. It has no relationship to a database, nor does it create an undo record.
I also prefer not using transactions, as shown in the OpenClose sample, it's more arx style

You can also roll your own container, i.e. subclass List and dispose the elements
similar to doing something like std::vector<AcDbObjectPointer>