What is an UpdateGraphConflictException and how do I fix it?

My code is throwing an UpdateGraphConflictException, but I don't know what that means or why it's happening. Why does this happen and how can I fix it?

An UpdateGraphConflictException has two primary causes. Each cause produces a different error message, so check the message to identify which applies.

1. Running the engine outside a Deephaven server

Error message: Table was constructed with a static-only UpdateGraph.

This applies to Java applications that embed the Deephaven engine directly. In a Deephaven server or console, Python code on the script session's thread already has an update graph in its execution context. A thread that your Python code starts has no execution context until you open one in it. Get the script session's context with get_exec_ctx, then open it in the thread with a with statement, as shown in Table operations in a separate thread.

The Deephaven engine can run outside of a Deephaven server, such as in a standalone Java application. When run this way, the current thread must have an execution context that holds an update graph before it constructs a refreshing (ticking) table. An update graph is the engine component that processes each ticking table's changes in cycles. If the thread has no real update graph, the table is created against a static-only placeholder and the engine throws an UpdateGraphConflictException.

Consider a TablePublisher, which produces a blink table from added tables. This is a common way to construct a ticking table from a variety of streaming data sources. When run from a Deephaven server, the necessary engine state is set up automatically. However, when run outside of the server, you must set it up manually.

The code below constructs an execution context with an update graph and opens it on the current thread. The update graph is passed to TablePublisher.of, which is necessary to ensure that the publisher can properly refresh the table when new data is available.

Note

This context sets only the update graph. Operations that compile formulas — such as update, where with a string filter, and so on — also need a QueryLibrary, QueryScope, and QueryCompiler. See the execution context page for details.

2. Combining ticking tables from separate update graphs

Error message: Multiple update graphs found in dependencies

Every ticking table belongs to exactly one update graph, which processes that table's changes. Consider the following scenario, with two separate update graphs:

  • Update graph A
    • Ticking table A
  • Update graph B
    • Ticking table B

You want to combine these two ticking tables into a single table. Each update graph runs its own update cycles, so no single cycle could process changes from both tables consistently. When an operation has refreshing inputs from more than one update graph, the engine throws an UpdateGraphConflictException with the message "Multiple update graphs found in dependencies". Static (non-refreshing) tables are not checked.

Because static tables are exempt from this check, you can snapshot each table to produce a static copy, then combine the static results.

Note

These FAQ pages contain answers to questions about Deephaven Community Core that our users have asked in our Community Slack. If you have a question that is not answered in our documentation, join our Community and ask it there. We are happy to help!