hibernate/hibernate-orm · error · IllegalArgumentException

Invalid mix of named and positional parameters

Error message

Invalid mix of named and positional parameters

What it means

Spec-required translation in getOutputParameterValue(int): the underlying Outputs machinery raised ParameterStrategyException because the call mixes named and positional parameter registrations, which the JPA positional accessor cannot honor. The faulty input is the ProcedureCall's parameter registration style; use only named or only positional parameters in one call.

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.
Defensive patterns

Strategy: validation

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.

Appendix: 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)