Transaction commit is time consuming
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi , Good morning.
I am facing a issue for Transaction commit, I am setting one shared parameter value for an element. Let's say I have 10 elements so for each element I am adding a counter + some string as parameter value and setting it to an element. But found that even for lesser number of elements the Transaction commit taking time more than enough. If I have not increment the counter in loop then transaction commit is quite faster, lets say 3 times faster than previous. But I have to increment the counter to get proper value for parameter.
Here is snip of my code
using (Transaction transaction = new Transaction(doc, "Set Parameters"))
{
transaction.Start();
int counter=0;
foreach (var element in elements)
{
string sample =counter.ToString() +"_Test";
element.Source.get_Parameter(testguid).Set(sample);
counter++;
}
transaction.Commit();
}
if I skip "counter++" my code is faster.
Please help me out to understand what's going wrong on my side.
Developer Advocacy and Support +