hibernate / hibernate-reactive

A reactive API for Hibernate ORM, supporting non-blocking database drivers and a reactive style of interaction with the database.
https://hibernate.org/reactive
Apache License 2.0
425 stars 89 forks source link

Postgres Quarkus Panache Suppressed: io.vertx.core.impl.NoStackTraceThrowable: Parameter at position[2] with class = [org.hibernate.engine.jdbc.BlobProxy] and value = [org.hibernate.engine.jdbc.BlobProxy@6949d1f3] can not be coerced to the expected class = [io.vertx.core.buffer.Buffer] for encoding. #1944

Open dkostakev opened 1 week ago

dkostakev commented 1 week ago

Hi, I am new to Quarkus and Hibernate reactive. I am using it with Postgres and I am getting the following error :

Suppressed: io.vertx.core.impl.NoStackTraceThrowable: Parameter at position[2] with class = [org.hibernate.engine.jdbc.BlobProxy] and value = [org.hibernate.engine.jdbc.BlobProxy@6949d1f3] can not be coerced to the expected class = [io.vertx.core.buffer.Buffer] for encoding.

My code looks like :

I have an entity class which I define as @Lob public byte[] data;

and in database I have a column with the following definition

data BYTEA NOT NULL

I am using Quarkus version 3.1.0.Final

with dependency management :

`

${quarkus.platform.group-id} ${quarkus.platform.artifact-id} ${quarkus.platform.version} pom import ` The repository is defined as : @ApplicationScoped public class LogoRepository extends AbstractRepository implements PanacheRepository { ... This exception is being thrown when calling "repository.persist(entity)". Could you please help me resolve this issue?
gavinking commented 1 week ago

Did you try removing the @Lob annotation and using @Column(length=LONG) as explained here:

https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#lobs

DavideD commented 1 week ago

It's probably related to this issue in Hibernate Reactive.

dkostakev commented 1 week ago

Did you try removing the @Lob annotation and using @Column(length=LONG) as explained here:

https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#lobs

Did you try removing the @Lob annotation and using @Column(length=LONG) as explained here:

https://docs.jboss.org/hibernate/orm/6.5/introduction/html_single/Hibernate_Introduction.html#lobs

I am trying to use byte[] instead of String

gavinking commented 1 week ago

It's probably related to this issue in Hibernate Reactive.

I don't think so. The user states that the database column is declared:

data BYTEA NOT NULL

So they should not be using @Lob in the first place.