# Exception Handling Impact on Service (API) Response Time

**URL:** <https://community.criticalmanufacturing.com/t/exception-handling-impact-on-service-api-response-time/567>\
**Category:** Extensibility\
**Tags:** v11.3, business-rules\
**Created:** [March 11, 2025, 9:11pm UTC](https://community.criticalmanufacturing.com/t/exception-handling-impact-on-service-api-response-time/567 "2025-03-11T21:11:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![irina\_gorlik](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@irina\_gorlik](https://community.criticalmanufacturing.com/u/irina_gorlik)\
**Post date:** [March 11, 2025, 9:11pm UTC](https://community.criticalmanufacturing.com/t/exception-handling-impact-on-service-api-response-time/567/1 "2025-03-11T21:11:38Z")

</div>

I’ve encountered an issue where calling a service or DEE that generates an exception results in significantly slower response times compared to the same request without throwing an exception.

Has anyone else experienced this? What could be causing the delay, and are there any best practices for optimizing exception handling to improve response times?

Looking forward to your insights and suggestions!

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Paiva](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@Rodrigo\_Paiva](https://community.criticalmanufacturing.com/u/Rodrigo_Paiva)\
**Post date:** [March 12, 2025, 10:51am UTC](https://community.criticalmanufacturing.com/t/exception-handling-impact-on-service-api-response-time/567/2 "2025-03-12T10:51:53Z")

</div>

Hi Irina,

By itself, exceptions in C# already have a performance cost, but in general that cost should not be a “significantly slower response”.  
On thing that may be happening is, because every API call in our system has its own transaction, and when an exceptions happen the transaction is rolled back, meaning that every data change in data in the Database is then reverted, if the API that you are calling touches many records in the Database, the rollback after an exception may take a little time.

But this is just one possible cause, my recommendation is for you to investigate further what point in the code takes time after the exception happens.

Best regards,

Rodrigo Paiva

---

<div class="post-metadata">

**Author:** ![irina\_gorlik](https://avatars.discourse-cdn.com/v4/letter/i/e274bd/32.png) [@irina\_gorlik](https://community.criticalmanufacturing.com/u/irina_gorlik)\
**Post date:** [March 17, 2025, 2:47pm UTC](https://community.criticalmanufacturing.com/t/exception-handling-impact-on-service-api-response-time/567/3 "2025-03-17T14:47:52Z")

</div>

Thanks Rodrigo, Is there a way to trigger an exception without rolling back the transactions ?

---

<div class="post-metadata">

**Author:** ![Joao\_Roque](https://yyz2.discourse-cdn.com/flex050/user_avatar/community.criticalmanufacturing.com/joao_roque/32/24_2.png) [@Joao\_Roque](https://community.criticalmanufacturing.com/u/Joao_Roque)\
**Post date:** [March 25, 2025, 12:24pm UTC](https://community.criticalmanufacturing.com/t/exception-handling-impact-on-service-api-response-time/567/4 "2025-03-25T12:24:03Z")

</div>

**Luís Ponte** wrote:

No, exceptions will always force you to rollback the transaction in our framework. There are some edge cases where this may be possible (for example, if you are catching an exception when writing to a file, for example), but as a general guideline, you should assume that your transaction should be rolled back whenever an exception occurs.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex050/user_avatar/community.criticalmanufacturing.com/system/32/23_2.png) [@system](https://community.criticalmanufacturing.com/u/system)\
**Post date:** [August 27, 2026, 5:39pm UTC](https://community.criticalmanufacturing.com/t/exception-handling-impact-on-service-api-response-time/567/5 "2026-08-27T17:39:18Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
