Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassCastException when Hibernate tries to create a list of UUIDs for query since Quarkus 3.7.1 #38660

Closed
b-thiswatch opened this issue Feb 7, 2024 · 5 comments
Labels
area/hibernate-orm Hibernate ORM area/persistence kind/bug Something isn't working triage/invalid This doesn't seem right triage/needs-reproducer We are waiting for a reproducer. triage/upstream Used for issues which are caused by issues in upstream projects/dependency

Comments

@b-thiswatch
Copy link

b-thiswatch commented Feb 7, 2024

Describe the bug

With quarkus-hibernate-orm-panache-kotlin we have Countries and Cities with @ManyToOne and @OneToMany relation and discovered that when we call CitiyEntity.listAll(), it crashes with java.lang.IllegalStateException: Illegal pop() with non-matching JdbcValuesSourceProcessingState which is created by a ClassCastException when Hibernate tries to retrieve all Countries with a FROM-Query on Countries by using where in and converting a list of UUIDs.

wrapped[ select ce1_0.id,ce1_0.iso,ce1_0.iso3,ce1_0.name,ce1_0.nice_name,ce1_0.num_code,ce1_0.phone_code from country ce1_0 where ce1_0.id = any (?) ]

@Override
			protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException {
				st.setBytes( index, javaType.unwrap( value, byte[].class, options ) );
			}
Screenshot 2024-02-07 at 19 26 34

When using the debugger and "Evaluate Expression" to run CityEntity.listAll() multiple times, it works after the first time.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

21

Quarkus version or git rev

3.7.1

Build tool (ie. output of mvnw --version or gradlew --version)

mvnw

Additional information

No response

@b-thiswatch b-thiswatch added the kind/bug Something isn't working label Feb 7, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented Feb 7, 2024

/cc @gsmet (hibernate-orm), @yrodiere (hibernate-orm)

@yrodiere
Copy link
Member

Hey @b-thiswatch , thanks for reporting.

Can you please provide a reproducer?

Even better would be reproducing with the plain Hibernate ORM test case templates without Quarkus and reporting directly to the ORM project (mentioning this Quarkus issue in the description), because this really doesn't look like a bug in Quarkus, but rather in Hibernate ORM.

@yrodiere yrodiere added triage/upstream Used for issues which are caused by issues in upstream projects/dependency triage/needs-reproducer We are waiting for a reproducer. labels Feb 12, 2024
@b-thiswatch
Copy link
Author

Hi @yrodiere ,

when updating Quarkus to 3.7.3 the Exception became clearer and trying to build a reproducer, I realised we ran into vladmihalcea/hypersistence-utils#698

We also updated to using the new native PostgresqlEnums...

Thanks for looking into this

@gsmet
Copy link
Member

gsmet commented Feb 14, 2024

Nice, thanks for the feedback!

@yrodiere
Copy link
Member

Thanks for the update!

@yrodiere yrodiere closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2024
@yrodiere yrodiere added the triage/invalid This doesn't seem right label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/persistence kind/bug Something isn't working triage/invalid This doesn't seem right triage/needs-reproducer We are waiting for a reproducer. triage/upstream Used for issues which are caused by issues in upstream projects/dependency
Projects
None yet
Development

No branches or pull requests

3 participants