@Rosa Junior, Carlos
Thanks for reaching out.
In Azure Durable Functions, while you can implement the fan-out/fan-in pattern to run multiple queries in parallel using orchestrator and activity functions, reusing a hdbcli.Connection
object across different activity executions is not supported.
This is because:
Durable Functions require all data passed between functions to be JSON-serializable, and database connections are not.
Each activity function runs in isolation, potentially on different compute instances, and does not share memory or state.
Azure Functions documentation recommends reusing static clients only when they are thread-safe and designed to manage connections internally (e.g., HttpClient
, CosmosClient
). Reference: Azure Functions best practices – Reuse client instances
As hdbcli.Connection
is not documented as thread-safe or connection-pooled, it is not suitable for reuse across multiple activity executions.
Instead, we recommend establishing a new connection within each activity function invocation using the necessary credentials or config parameters. Hope this helps. Do let us know if you have any further queries.
If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.