Is there a problem if I write my code like this:
using (ACADDocument.LockDocument())
{
using (var ts = ACADDatabase.TransactionManager.StartTransaction())
{
using(ACADDocument.LockDocument())
{
using (var ts1 = ACADDatabase.TransactionManager.StartTransaction())
{
//do some action using ts1 transaction
ts1.Commit();
}
}
// do other action using ts transaction, which may or may not involve the objects in ts1 transactino
ts.Commit();
}
}
Setting aside the issue of whether this is the best way to do something, is it OK in all circumstances? Will it cause a problem if, for the ts transaction, I do something involving objects that I use in ts1?
I got myself down this rabbit hole because of my zeal to wrap the code in functors and lambdas to simplify the code. But let's not argue whether this is good or not, just merely whether this will introduce unwanted behaviors or crashes.
Solved! Go to Solution.
Solved by soonhui. Go to Solution.
hi @soonhui
i think it's an Autocad question moving your post to Autocad .Net forum is better.
I think this question can be deleted now; I've reasked at AutoCAD .Net forum.