Skip to content

Fix binding of parameters in ReactiveExecuteWithTemporaryTableHelper#loadInsertedRowNumbers #2414

@DavideD

Description

@DavideD

It happene with the Hibernate ORM upgrade to 7.1
In 3.1 the code is here:

PreparedStatement preparedStatement = null;
preparedStatement = jdbcCoordinator.getStatementPreparer().prepareStatement( sqlSelect );
Object[] parameters = new Object[1];
if ( sessionUidColumn != null ) {
        parameters[0] = UUID.fromString( sessionUidAccess.apply( session ) );
}

PreparedStatement is not used, and in Hibernate Reactive the binding is done via an adapter.
It should look something like this:

final Object[] parameters = PreparedStatementAdaptor
    .bind( statement -> {
        if ( sessionUidColumn != null ) {
            sessionUidColumn.getJdbcMapping().getJdbcValueBinder()
						.bind( statement, UUID.fromString( sessionUidAccess.apply( session ) ), 1, session );
        }
    } );

But there is no test case at the moment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions