Skip to content

Commit c743fa9

Browse files
committed
4.x: Tests fail when upgrading to Hibernate 6.6.23.Final helidon-io#10441
Signed-off-by: Jorge Bescos Gascon <[email protected]>
1 parent 75392a9 commit c743fa9

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

dependencies/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
<version.lib.h2>2.2.220</version.lib.h2>
7070
<version.lib.hamcrest>1.3</version.lib.hamcrest>
7171
<version.lib.handlebars>4.4.0</version.lib.handlebars>
72-
<version.lib.hibernate.family>6.3</version.lib.hibernate.family>
73-
<version.lib.hibernate>${version.lib.hibernate.family}.1.Final</version.lib.hibernate>
72+
<version.lib.hibernate.family>6.6</version.lib.hibernate.family>
73+
<version.lib.hibernate>${version.lib.hibernate.family}.23.Final</version.lib.hibernate>
7474
<version.lib.hibernate-validator>8.0.2.Final</version.lib.hibernate-validator>
7575
<version.lib.hikaricp>5.0.1</version.lib.hikaricp>
7676
<version.lib.hystrix>1.5.18</version.lib.hystrix>

integrations/cdi/jpa-cdi/src/test/java/io/helidon/integrations/cdi/jpa/chirp/TestJpaTransactionScopedSynchronizedEntityManager.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2023 Oracle and/or its affiliates.
2+
* Copyright (c) 2019, 2025 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -292,9 +292,9 @@ void testJpaTransactionScopedSynchronizedEntityManager()
292292
assertThat(transactionScopedContext.isActive(), is(true));
293293

294294
// Remove the Author we successfully committed before. We
295-
// have to merge because author1 became detached a few lines
296-
// above.
297-
author1 = em.merge(author1);
295+
// have to find because author1 became detached a few lines
296+
// above and it is not allowed to attach it again with merge.
297+
author1 = em.find(Author.class, Integer.valueOf(1));
298298
assertThat(author1, notNullValue());
299299
assertThat(em.contains(author1), is(true));
300300
em.remove(author1);
@@ -313,13 +313,15 @@ void testJpaTransactionScopedSynchronizedEntityManager()
313313
// tables.
314314
assertTableRowCount(dataSource, "AUTHOR", 0);
315315

316-
// Start a new transaction, merge our detached author1, and
316+
// Start a new transaction, persist our detached author1, and
317317
// commit. This will bump the author's ID and put a row in
318318
// the database.
319319
tm.begin();
320320
assertThat(em.isJoinedToTransaction(), is(true));
321321
assertThat(transactionScopedContext.isActive(), is(true));
322-
author1 = em.merge(author1);
322+
author1 = new Author("Abraham Lincoln");
323+
em.persist(author1);
324+
em.merge(author1);
323325
tm.commit();
324326
assertThat(em.isJoinedToTransaction(), is(false));
325327
assertThat(em.contains(author1), is(false));

integrations/cdi/jpa-cdi/src/test/java/io/helidon/integrations/cdi/jpa/chirp/TestRollbackScenarios.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019, 2023 Oracle and/or its affiliates.
2+
* Copyright (c) 2019, 2025 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -276,6 +276,8 @@ void testRollbackScenarios()
276276
assertThat(tm.getStatus(), is(Status.STATUS_ACTIVE));
277277
assertThat(em.isJoinedToTransaction(), is(true));
278278
assertThat(em.contains(author), is(false));
279+
author = new Author("John Kennedy");
280+
em.persist(author);
279281
author = em.merge(author);
280282
em.remove(author);
281283
tm.commit();

tests/integration/packaging/mp-2/src/main/resources/META-INF/native-image/io.helidon.tests.integration.packaging/helidon-tests-integration-packaging-mp2/native-image.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2023, 2024 Oracle and/or its affiliates.
2+
# Copyright (c) 2023, 2025 Oracle and/or its affiliates.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -14,5 +14,5 @@
1414
# limitations under the License.
1515
#
1616

17-
Args=--initialize-at-build-time=io.helidon.tests.integration.packaging.mp2 \
18-
--enable-url-protocols=http
17+
Args=--initialize-at-build-time=io.helidon.tests.integration.packaging.mp2,net.bytebuddy \
18+
--enable-url-protocols=http

0 commit comments

Comments
 (0)