Author Topic: StartOpenCloseTransaction vs StartTransaction?  (Read 1479 times)

0 Members and 1 Guest are viewing this topic.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
StartOpenCloseTransaction vs StartTransaction?
« 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,
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2132
  • class keyThumper<T>:ILazy<T>
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: StartOpenCloseTransaction vs StartTransaction?
« Reply #2 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>