[h2] Re: Problem updating from 1.4.199 to 2.1.214

2023-02-21 Thread Kris
I was able to update to Spring 2.7.8 which mvn dependency:tree shows as 
using hibernate 5.6.14.Final. I get the same results with that. If I 
override the dependency to 5.6.15.Final I still get the same results.

The SQL datatype for the UUID field is CHAR(9) which was defined 20+ years 
ago so I'm mimicking that in the Unit tests in the schema.sql file.

The join in the child table object is defined by:

@ManyToOne
@JoinColumn(name = "uuid")
private Person person;

And in the parent object by:

@OneToMany(fetch = FetchType.LAZY, mappedBy = "person", cascade = 
{CascadeType.ALL}, orphanRemoval = true)
private Set surnames;

With the uuid value defined as:

@Id
@Column(name = "UUID")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = 
"personseq_generator")
private Integer uuid;

As I mentioned. it all worked before, it seems to work in Oracle outside of 
unit tests, and using Derby for the unit tests so I'm perplexed as to why 
it's not successful with H2.

Thanks,
Kris

On Friday, February 10, 2023 at 12:34:56 AM UTC-7 Evgenij Ryazanov wrote:

> Hello!
>
> 2.5.5 is too old and it has hibernate-core 5.4.32.Final in its 
> dependencies, this version doesn't support any new versions of H2. You need 
> to check version of Hibernate ORM actually used by your application and 
> upgrade it to 5.6.15.Final or 6.1.7.Final if necessary.
>
> You also need to check SQL data types of columns with UUID values if you 
> have them, because Hibernate ORM can incorrectly choose some wrong data 
> type such as BINARY(255) for them, in historic versions of H2 it was 
> acceptable, because it was incorrectly implemented as BINARY VARYING(255), 
> but in new versions of H2 these data types have different 
> standard-compliant implementations. The best data type for H2 is UUID, but 
> BINARY(16) can also be used. Attempts to use BINARY(255) cause various 
> problems, such as https://hibernate.atlassian.net/browse/HHH-15373
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/1295c3d6-5f93-4177-87be-a2d42a493545n%40googlegroups.com.


[h2] Re: Problem updating from 1.4.199 to 2.1.214

2023-02-09 Thread Evgenij Ryazanov
Hello!

2.5.5 is too old and it has hibernate-core 5.4.32.Final in its 
dependencies, this version doesn't support any new versions of H2. You need 
to check version of Hibernate ORM actually used by your application and 
upgrade it to 5.6.15.Final or 6.1.7.Final if necessary.

You also need to check SQL data types of columns with UUID values if you 
have them, because Hibernate ORM can incorrectly choose some wrong data 
type such as BINARY(255) for them, in historic versions of H2 it was 
acceptable, because it was incorrectly implemented as BINARY VARYING(255), 
but in new versions of H2 these data types have different 
standard-compliant implementations. The best data type for H2 is UUID, but 
BINARY(16) can also be used. Attempts to use BINARY(255) cause various 
problems, such as https://hibernate.atlassian.net/browse/HHH-15373

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/861c9172-d9c7-4cfb-8724-5b822d320fa9n%40googlegroups.com.