hibernate/hibernate-orm · error · IllegalArgumentException

Invalid mix of named and positional parameters

Error message

Invalid mix of named and positional parameters

What it means

Error "Invalid mix of named and positional parameters" thrown in hibernate/hibernate-orm.

Source

Thrown at hibernate-core/src/main/java/org/hibernate/procedure/internal/ProcedureCallImpl.java:1232

			execute();
			// The expectation is that there is just one Output,
			// of type UpdateCountOutput
			return getUpdateCount();
		}
		finally {
			getOutputs().release();
		}
	}

	@Override
	public Object getOutputParameterValue(int position) {
		checkNotClosed();
		// According to spec, an exception thrown from this method should not mark for rollback.
		try {
			return getOutputs().getOutputParameterValue( position );
		}
		catch (ParameterStrategyException e) {
			throw new IllegalArgumentException( "Invalid mix of named and positional parameters", e );
		}
		catch (NoSuchParameterException e) {
			throw new IllegalArgumentException( e.getMessage(), e );
		}
	}

	@Override
	public Object getOutputParameterValue(@Nonnull String parameterName) {
		checkNotClosed();
		// According to spec, an exception thrown from this method should not mark for rollback.
		try {
			return getOutputs().getOutputParameterValue( parameterName );
		}
		catch (ParameterStrategyException e) {
			throw new IllegalArgumentException( "Invalid mix of named and positional parameters", e );
		}
		catch (NoSuchParameterException e) {
			throw new IllegalArgumentException( e.getMessage(), e );

View on GitHub (pinned to fad1729dce)

Solutions

  1. Use only named parameters or only positional parameters in a single procedure call, not both.
  2. Re-register all parameters with a consistent naming style.

When it happens

Trigger: A stored procedure / query parameter is bound or referenced inconsistently with its registration.

Common situations: Calling StoredProcedureQuery or Query with missing, misnamed, or mixed named/positional parameters.


AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22). Data as JSON: /api/errors/e9f681bf8519a77f. Report an issue: GitHub.