Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is my current code.
protected void Write(Action<Transaction> action)
{
using (ACADDocument.LockDocument())
{
using (var ts = ACADDatabase.TransactionManager.StartTransaction())
{
try
{
action(ts);
ts.Commit();
}
catch (Exception ex)
{
// log the error
ts.Abort(); // is this necessary at all?
throw;
}
}
}
}
But I wonder whether there is a need to call Transaction.Abort() in the catch, because if a transaction is not committed then it's automatically aborted ( or is it?)
If that's the case, then why do we need Abort() method at all?
Can anyone clarify on this?
##########
Ngu Soon Hui
##########
I'm the Benevolent Dictator for Life for MiTS Software. Read more here
I also setup Civil WHIZ in order to share what I learnt about Civil 3D
Ngu Soon Hui
##########
I'm the Benevolent Dictator for Life for MiTS Software. Read more here
I also setup Civil WHIZ in order to share what I learnt about Civil 3D
Solved! Go to Solution.