Autocad Transaction and multi layer application

Autocad Transaction and multi layer application

Anonymous
Not applicable
706 Views
1 Reply
Message 1 of 2

Autocad Transaction and multi layer application

Anonymous
Not applicable

I am working on a multi-layered application that is Data acess, Bussiness and UI layer. The application works with several providers like Autocad and Sketchup. All the Autocad/Sketchup specific APIs are dealt with in Data Acess layer. The thing is, in a modaless application, to hide the Atuocad specific APIs like the transaction calls(oppening/clossing/commiting) and to keep it on the Data Access layer the cost is high as on each call a new transaction has to be opened whereas a possible one single transaction in the UI layer can handle the fetching/updating more quickly. 

 

So my question is that is there a way to keep the transaction activities on DAL or to just open it once on loading the application and disposing it on unloading/closing the application/form.

 

Thanks,

Ali

0 Likes
Accepted solutions (1)
707 Views
1 Reply
Reply (1)
Message 2 of 2

augusto.goncalves
Alumni
Alumni
Accepted solution
If you leave the transaction open, AutoCAD will remain "on hold" and will crash if any other command tries to interact with it.

AutoCAD expects that, for each command, a top (and child) transaction will open, close and dispose. If not, it may behave unexpected and, most likely, crash.

As you have an external type of call (not sure how you handle multi-thread and concurrence), you may try StartOpenCloseTransaction and Commit transactions (Abort takes longer).
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes