Clarification on Uncaught Database Exception Handling in Service Task

I am reaching out regarding an issue I’m encountering in my BPMN process where a service task fails due to a database connection error (idle-in-transaction timeout). Specifically, this exception is not being caught by the try-catch block within my service task class (MDServiceTask), which is affecting the flow execution.

In my service task implementation, this SQL exception occurs while Camunda performs a query on the ACT_GE_BYTEARRAY table during an execution.getVariable() call within a try block. I’ve followed this with a generic catch block for Exception, yet the exception is not handled by this block. Instead, the exception leads to a failure in the service task node, which then halts the execution of the process.

Could you help clarify how Camunda handles exceptions in this context? Specifically:

Is Camunda intercepting this exception at the engine level in a way that bypasses the application-level try-catch block, resulting in a task failure state instead of allowing it to be handled within the Java class?
Additionally, after this initial database exception, there is a rollback exception triggered by Spring, which is also not caught by the class-level try-catch block. Could you clarify why this might be happening?

Below is the code snippet for the catch block:

catch (Exception ex) {
log.error(“Exception occured while fetching details error {}”,ex.getMessage());
throw new BpmnError(ex.getMessage());
}

Here are the relevant log details for the error:

CamundaExceptionLogs.yaml (48.3 KB)

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