question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update to Hibernate 5.2.10

See original GitHub issue

Hello, I just switched to DW 1.1.0 (from 1.0.6) and immediately found a problem with the new Hibernate (5.2.8). It is described pretty good here: https://hibernate.atlassian.net/browse/HHH-11496

It seems, I am experiencing the same thing. I have two entities: Club and Tenant Club:

@Entity
public class Club {
  @Id
  @GeneratedValue
  private Integer id;

  @Column(nullable = false)
  private String name;

  @OneToOne
  @JoinColumn(name = "tenant_id")
  private Tenant tenant;
...
}

and Tenant:

@Entity
public class Tenant {
  @Id
  @GeneratedValue
  private Integer id;

  @OneToOne(mappedBy = "tenant", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
  private Club club;
...
}

Well, basically, constructing these entities I followed the official Hibernate User Guide. Everything worked fine in DW 1.0.6 (and HIbernate 5.1.0 respectively) but after switching I noticed exceptions reporting about ConstraintViolations. I checked the logs, debugged and saw that Hibernate tries to insert a Club first, however, it should insert it only after Tenant.

Writing a test for this would be pretty time consuming task. If you really need this - I might try.

Have you experiences anything like this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arteamcommented, Apr 22, 2017

Done

0reactions
arteamcommented, Apr 27, 2017

Should be resolved as part of #2021.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5.2 series - Hibernate ORM
Idiomatic persistence for Java and relational databases.
Read more >
How to upgrade Hibernate from version 4.3 to 5.2 for migration ...
1 Answer 1 ... Speaking merely about dependencies, the upgrade from Hibernate 4.3.x to >= 5.2.x is pretty straight forward. The latest >=...
Read more >
Browse /hibernate-orm/5.2.10.Final at SourceForge.net
An object relational-mapping (ORM) library for Java ... Collect, search, and correlate detailed logs from applications, infrastructure, and ...
Read more >
hibernate-core » 5.2.10.Final - Maven Repository
Category/License, Group / Artifact, Version, Updates. Parser Generator, logo, antlr » antlr · 2.7.7, ✓. Reflection Apache 2.0, logo ...
Read more >
Hibernate ORM 5.2.18.Final User Guide - Red Hat on GitHub
The same goes when the Person entity is updated. Hibernate is going to fetch the calculated fullName column from the database after the...
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