Commit Graph

10680 Commits

Author SHA1 Message Date
Yoann Rodière 46452f2482 HHH-14326 Test JDBC resources are released before closing the connection
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-20 10:05:28 +00:00
Yoann Rodière e2b7299e15 HHH-14326 Always close the connection even if releasing JDBC resources fails
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-20 10:05:22 +00:00
Yoann Rodière 44b9303877 HHH-14326 Release JDBC resources before closing the connection
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-20 10:05:16 +00:00
Nathan Xu e994736ec9 HHH-14407 NPE in Column.getSqlTypeCode(Mapping mapping) for column 'hib_sess_id' when using PersistentTableBulkIdStrategy 2021-01-15 15:23:29 +00:00
Gail Badner 15e59b3690 HHH-13658 : Remove @LazyToOne(NO_PROXY) from classes used with bytecode-proxies enabled. FetchGraphTest#testRandomAccess failed so it was marked @FailureExpected.
(cherry picked from commit 602926bf9b)
2021-01-13 16:20:56 -08:00
Steve Ebersole ee1b4ab2cb HHH-13658 : make NO_PROXY unnecessary
- Better handle `FetchModeType#LAZY` for to-one associations based on whether bytecode-enhancement-as-proxy is enabled.  Minimize the cases a user is likely to need to use `@LazyToOne`
- See also EAP7-1402

(cherry picked from commit 0c974991f7)
2021-01-13 12:07:36 -06:00
Yoann Rodière 51dafa9245
HHH-14371 Open java.base/java.lang to the unnamed module in Proxool tests
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:21:06 +01:00
Yoann Rodière 91269dccab
HHH-14371 Add --add-opens options required for Gradle plugin tests
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:21:06 +01:00
Yoann Rodière d89ebc2097
HHH-14371 Open java.base/java.lang to the unnamed module in javassist tests
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:21:06 +01:00
Yoann Rodière 50d5be3abf
HHH-14371 Move tests specific to Javassist to the appropriate source set
Otherwise they won't be executed with the appropriate JVM args.

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:21:05 +01:00
Yoann Rodière 0dd322d4be
HHH-14371 Open java.base/java.security and java/base/java.lang to the unnamed module in tests
Weld needs this, in CDI tests.

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:21:05 +01:00
Yoann Rodière f2a866e0af
HHH-14371 Open java.base/java.nio.charset to the unnamed module in tests
NamingHelper test needs access to Charset.defaultCharset.

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:21:05 +01:00
Yoann Rodière 6845edd74e
HHH-14371 Correctly set JVM args in the JVM running tests
Turns out getJvmArgs() returns a copy, so modifying that copy won't
change the JVM args.

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:21:05 +01:00
Yoann Rodière ab44830251
HHH-14372 Upgrade to Weld 3.1.5.Final in tests
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:21:05 +01:00
Yoann Rodière 2010497df9
HHH-14370 Add --add-opens options required for Gradle
In order to work around illegal accesses in Gradle.

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:21:05 +01:00
Yoann Rodière 00a2486c27
HHH-14315 Upgrade Travis build to OpenJDK 11.0.9
For some reason the gradle build gets stuck at task
:hibernate-core:compileTestJava when using OpenJDK 11.0.3.
I can't reproduce the problem with 11.0.9, though, so it's probably a
bug in OpenJDK 11.0.3.

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:15:35 +01:00
Yoann Rodière 08079035c7
HHH-14315 Force JVM options when using toolchains
Apparently Gradle won't just use the same options as in its own JVM.

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:15:35 +01:00
Yoann Rodière fb2a5cf94b
HHH-14315 Add optional support for toolchains to the Gradle build
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:15:35 +01:00
Yoann Rodière adcadc855c
HHH-14315 Upgrade to Gradle 6.7
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-07 17:15:35 +01:00
Yoann Rodière 4c15128838
HHH-14323 Restore the system property net.bytebuddy.experimental=true in tests on JDK15+
Turns out it's necessary for JDKs with experimental support.
2021-01-07 17:15:35 +01:00
Yoann Rodière 4bf0a96c22
HHH-14323 Allow forcing the tested Java version in the Gradle build
... just in case we need that for some cutting-edge JDK, for example 15,
that would not be supported by Gradle yet.
2021-01-07 17:15:35 +01:00
Yoann Rodière ddb474f7c3
HHH-14323 Enable extended bytecode enhancement in NaturalIdInUninitializedAssociationTest
This test accesses a field of an entity directly and expects it to be
automatically initialized; this cannot work without extended bytecode
enhancement.

This used to work with Java 8 bytecode, but only by chance. It seems
that Java 8 bytecode relies on "synthetic", static access methods
inserted by the compiler to access the fields of entities in this test:
any access to the field is done through this access method instead of
through a direct field access. Since we apply bytecode enhancement to
all methods of entities, this means that access to fields triggers
initialization, without any bytecode enhancement in the caller class.

I believe this is specific to nested classes, but couldn't find a
source. For reference, the bytecode of access methods looks like this:

  static int access$002(org.hibernate.test.bytecode.enhancement.lazy.NaturalIdInUninitializedAssociationTest$AnEntity, int);
    Code:
       0: aload_0
       1: iload_1
       2: dup_x1
       3: putfield      #3                  // Field id:I
       6: ireturn

  static org.hibernate.test.bytecode.enhancement.lazy.NaturalIdInUninitializedAssociationTest$EntityImmutableNaturalId access$102(org.hibernate.test.bytecode.enhancement.lazy.NaturalIdInUninitializedAssociationTest$AnEntity, org.hibernate.test.bytecode.enhancement.lazy.NaturalIdInUninitializedAssociationTest$EntityImmutableNaturalId);
    Code:
       0: aload_0
       1: aload_1
       2: dup_x1
       3: putfield      #2                  // Field entityImmutableNaturalId:Lorg/hibernate/test/bytecode/enhancement/lazy/NaturalIdInUninitializedAssociationTest$EntityImmutableNaturalId;
       6: areturn

With Java 11, however, access to fields of entities is done directly,
even for nested classes. So the access methods no longer exist, and we
don't get automatic initialization upon field access. We need extended
bytecode enhancement, like we would in any other case of field access
(in particular accessing fields of non-nested classes).
2021-01-07 17:15:34 +01:00
Yoann Rodière dfc04d8f5d
HHH-14323 Do not set net.bytebuddy.experimental=true in tests anymore
It's no longer necessary since we upgraded to byte-buddy 1.10.2,
and it causes bytecode to be converted from Java 14 to Java 12 in some
cases (I don't know why).
2021-01-07 17:15:34 +01:00
Yoann Rodière 1b44713d09
HHH-14323 Generate Java 13/14 bytecode for tests when building with JDK13/14 2021-01-07 17:15:34 +01:00
Yoann Rodière 96b2b71393
HHH-14323 Remove unnecessary checks around Java 8 compatibility
The build requires JDK8+, so we're alwways Java 8 compatible.
2021-01-07 17:15:34 +01:00
Hibernate-CI bbec5c3118 5.4.28-SNAPSHOT 2020-12-22 20:11:24 +00:00
Hibernate-CI d558f6526a 5.4.27.Final 2020-12-22 20:03:27 +00:00
Sanne Grinovero 21ec1a19d1 HHH-14385 Allow specifying a target JVM version for compatibility of generated proxies via ByteBuddy 2020-12-22 18:01:12 +00:00
Christian Beikov 89f0000b62 HHH-14380 - Only reorder destination from elements from the same from clause 2020-12-20 10:53:34 +01:00
Jan-Willem Gmelig Meyling c1baa23734 HHH-14380 Test case from https://github.com/Blazebit/blaze-persistence/pull/1237 for subquery in on-clause 2020-12-20 10:53:28 +01:00
jiangHZ 5a57bc9798 HHH-13913 An SQL Dialect for PostgreSQL 10 and later. Adds support for Partition table. 2020-12-16 14:40:35 +01:00
Hibernate-CI d901ccfa33 5.4.27-SNAPSHOT 2020-12-14 16:54:55 +00:00
Hibernate-CI 05792d9510 5.4.26.Final 2020-12-14 16:46:53 +00:00
Sanne Grinovero e21f4d3fe4 HHH-14356 Have Hibernate Envers produce a user friendly bootstrap exception if xml_mapping_enabled=false 2020-12-14 16:39:07 +00:00
Yanming Zhou 04c97c2293 HHH-14356 Avoid NPE when booting with xml_mapping_enabled=false
Introduced by HHH-14334
when use Envers with hibernate.xml_mapping_enabled=false
see 34151a9660 (r44735539)
2020-12-14 16:39:01 +00:00
Erin Schnabel 0009fec578 HHH-14337 Micrometer support 2020-12-14 14:55:52 +00:00
Christian Beikov 9e59f02e0f HHH-14360 Test a fix for NPE due to non-existing previous state in bytecode enhanced dirty attribute resolving 2020-12-11 15:16:30 +00:00
Andrea Boriero f8f88f4e3f HHH-14363 MutableTypeEnhancementTestCase failing when run on Oracle DB 2020-12-08 16:12:46 +01:00
Christian Beikov ea5b386df3 HHH-13945 Fix issues on PostgreSQL 2020-12-04 10:26:59 +01:00
Luke Chen 3f0277a33d HHH-13945: add debug log during exception thrown 2020-12-04 10:26:53 +01:00
Luke Chen 11e96fa039 HHH-13945: catch PersistenceException during envers unproxy the field value, and fallback to using proxy entity 2020-12-04 10:26:44 +01:00
Luke Chen 05a152b85c HHH-13945: fallback to call map if exception thrown 2020-12-04 10:26:38 +01:00
Hibernate-CI 8fb4da6fa5 5.4.26-SNAPSHOT 2020-12-01 15:33:46 +00:00
Hibernate-CI 4d8beecac0 5.4.25.Final 2020-12-01 15:23:53 +00:00
Andrea Boriero 70f3a9260b HHH-14242 Fix issue for Dialects supporting row value constructor Syntax but not in the SET clause 2020-11-30 20:46:45 +00:00
Andrea Boriero 54ea3c15bf HHH-14251 Fix issue for Dialects not supporting row value constructor Syntax 2020-11-30 20:46:40 +00:00
Andrea Boriero ec7a278358 HHH-14251 Invalid SQL for @Embedded UPDATE 2020-11-30 20:46:36 +00:00
Andrea Boriero cb04aa1e5d HHH-14251 Add test for issue 2020-11-30 20:46:31 +00:00
Michael Edgar 12b284cfcf HHH-14346 Check declaredPluralAttributes for null before access 2020-11-30 20:38:27 +00:00
nicklas.wallgren c215601025 HHH-14350 MariaDB103Dialect requires the lock wait timeout to be expressed in seconds 2020-11-30 20:37:26 +00:00