InvalidOperationException
Exception thrown when the driver attempts an operation that is not allowed in the current state or context.
Examples include trying to commit when auto-commit is enabled, operating on a closed statement, using unsupported features, or asking a query for something the call itself did not make possible.
Purely client-side: nothing here was reported by the server, so there is no sqlState and no serverErrorMessage. Raised inside a query, it still carries the queryContext - the SQL and the parameters - the way every driver exception does.
Properties
Where this happened, innermost first, appended to by each layer as the exception unwinds. It is on the base class for the same reason queryContext is: adding to it is the only thing a frame can do to an exception without replacing it, and replacing one costs the type the caller catches on - a ConstraintViolationException restated as something else stops being the failure a retry looks for. A mapper walking a nested composite appends the attribute it was on, a transaction plan the step and parameter it was resolving. Rendered reversed, outermost first, so PATH: step 1 -> parameter 'name' -> map #1 reads from the plan down to the lambda.
The context of the query that resulted in this exception, if applicable.
The specific type of invalid operation.
The raw error message received from the database, if applicable.