-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Changed JSON array is not persisted when using hibernate6 / jsonb #37184
Comments
Hey, You're saying they are "no longer" picked up, but can you detail what you were doing when they were picked up? Because persisting content as JSON was not even available in Quarkus 2.x... Regarding the underlying problem, I wonder if deep change tracking is even supported for properties annotated with As for workarounds, making your |
On Quarkus 2.x we're using io.quarkiverse.hibernatetypes/quarkus-hibernate-types and there we
have no issues with deep change tracking.
The example is as simple as I can make it. I'm not really making a todo
app. Our objects are much more complex so @struct is not an option for
us. Current workaround we are considering is detach+merge every time.
…On Wed, 22 Nov 2023 at 10:20, Yoann Rodière ***@***.***> wrote:
Hey,
You're saying they are "no longer" picked up, but can you detail what you
were doing when they *were* picked up? Because persisting content as JSON
was not even available in Quarkus 2.x...
Regarding the underlying problem, I wonder if deep change tracking is even
supported for properties annotated with @JdbcTypeCode(SqlTypes.JSON)...
Is it, @beikov <https://github.com/beikov>?
As for workarounds, making your Todo class an embeddable and using @struct
may help, though I'm not sure at all:
https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html#_struct_aggregate_embeddable_mapping
—
Reply to this email directly, view it on GitHub
<#37184 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACIHNFJP4NUZXIKB7XPKXLYFW7V3AVCNFSM6AAAAAA7QKB4QGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRSGM4DQNJXGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This is a bug that should be fixed as part of https://hibernate.atlassian.net/browse/HHH-17294 which will be part of 6.2.14.Final. |
Describe the bug
When upgrading to Quarkus 3.x, we have noticed that changes to entity properties mapped to a jsonb column in postgres were no longer picked up.
If you have a property in an entity of type TodoList:
and you set one of the todos to completed:
and you then persist the entity, I expect hibernate to detect the change and write it to the db. It doesn't.
Expected behavior
When changing only the contents of a jsonb property, the system should detect the change so it will write it to the db.
Actual behavior
The change is not detected and no UPDATE statement is made. Note that if another (non-json) change is made to the entity, the json does get persisted (see second test in reproducer project).
How to Reproduce?
https://github.com/piether/quarkus-hibernate-json-bug contains a failing test
Output of
uname -a
orver
Darwin V4C04H7X9R 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct 9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64
Output of
java -version
openjdk version "21" 2023-09-19 OpenJDK Runtime Environment Zulu21.28+85-CA (build 21+35) OpenJDK 64-Bit Server VM Zulu21.28+85-CA (build 21+35, mixed mode, sharing)
Quarkus version or git rev
3.5.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546) Maven home: /Users/pieter/.m2/wrapper/dists/apache-maven-3.9.5-bin/32db9c34/apache-maven-3.9.5 Java version: 21, vendor: Azul Systems, Inc., runtime: /Users/pieter/.sdkman/candidates/java/21-zulu/zulu-21.jdk/Contents/Home Default locale: en_BE, platform encoding: UTF-8 OS name: "mac os x", version: "14.1", arch: "aarch64", family: "mac"
Additional information
No response
The text was updated successfully, but these errors were encountered: