Passing null as stored procedure argument is broken in v2.7.0 (works in v2.6.8).

See original GitHub issue

With spring.jpa.properties.hibernate.proc.param_null_passing=true we can pass null as stored procedure as parameter without any problem with Spring Boot 2.6.8 but upgrading to v2.7.0 throws exception with the same Hibernate version. I’ve tried only with PostgreSQL and UUID as procedure parameter but I suppose it could be for any type of DB and parameters. The exception is: Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: Bind value [org.hibernate.jpa.TypedParameterValue@5b1420f9] was not of specified type [class java.util.UUID; nested exception is java.lang.IllegalArgumentException: Bind value [org.hibernate.jpa.TypedParameterValue@5b1420f9] was not of specified type [class java.util.UUID

Example:

public interface TestModelRepository extends JpaRepository<TestModel, Long> {
  @Procedure("countByUuid")
  void countUuid(UUID one);
}

then just call testModelRepository.countUuid(null). I’ve prepared a sample project to reproduce the problem, just change Spring Boot version to 2.6.8 and it works fine: https://github.com/denis111/spring-data-jpa270test

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:8
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
quaffcommented, Sep 14, 2022

is this still broken with 2.7.3? we downgraded to 2.6.8, waiting for the fix.

It should fixed in 2.7.3, but it’s not released yet. @gregturn

1reaction
quaffcommented, Oct 21, 2022

@denis111 It should be fixed at hibernate side, I have created https://github.com/hibernate/hibernate-orm/pull/5438

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to pass a null parameter to a stored procedure in ...
Yes, it is possible to pass null params to stored procedures when using JPA StoredProcedureQuery. You have to add the following property in...
Read more >
[HHH-9548] Allow propagation of NULL for stored-procedure ...
In the native Hibernate API this is done through org.hibernate.procedure.ParameterRegistration#enablePassingNulls . The default for this per-parameter is ...
Read more >
Passing null for a stored procedure parameter in Hibernate
Issue. The Hibernate 5.0 User Guide (section 22.7) documents the property hibernate.proc.param_null_passing which may be used to instruct ...
Read more >
PHP 7 ChangeLog
Fixed bug #81500 (Interval serialization regression since 7.3.14 / 7.4.2). ... Fixed bug #64638 (Fetching resultsets from stored procedure with cursor ...
Read more >
GNU make
5.7.1 How the MAKE Variable Works; 5.7.2 Communicating Variables to a Sub- make ... Comments within a recipe are passed to the shell, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found