10604 Commits

Author SHA1 Message Date
Yoann Rodière
77a847cb38 HHH-14444 Encapsulate ID generation in GenerationState for PooledLoThreadLocalOptimizer
This is just a cosmetic change, it doesn't change the behavior at all.

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-02-09 09:29:47 +00:00
Yoann Rodière
77467d00f1 HHH-14444 Avoid synchronization for multi-tenant generation in PooledLoThreadLocalOptimizer
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-02-09 09:29:47 +00:00
Yoann Rodière
9658fc8f49 HHH-14444 Avoid synchronization for single-tenant generation in PooledLoThreadLocalOptimizer
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-02-09 09:29:47 +00:00
Yoann Rodière
fe965d1919 HHH-14444 Test concurrent usage of ID generator optimizers
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-02-09 09:29:47 +00:00
Andrea Boriero
e8fb4d8403 HHH-14445 Javassist skip EntityWithMutableAttributesTest, LoadAndUpdateEntitiesWithCollectionsTest, SimpleDynamicUpdateTest, SimpleDynamicUpdateTest 2021-02-08 16:42:21 +01:00
Andrea Boriero
8af3b9ccbe HHH-14424 When enhanced as a proxy is enabled with dirty checking, on flush uninitialized entities containing collections are updated and all the fields are set to null 2021-02-08 14:40:49 +00:00
Andrea Boriero
fb5f02b520 HHH-14424 Add test for issue 2021-02-08 14:40:41 +00:00
Christian Beikov
d4b3bf3a97 HHH-14408 Defer property type access until integrators ran 2021-02-05 09:15:10 +00:00
Christian Beikov
6ee8135a29 HHH-14408 Test that user type provided by integrator is properly registered 2021-02-05 09:15:10 +00:00
Yanming Zhou
20f6d4f5db HHH-14229 Fix unexpected foreign key creation
before this commit, foreign key is created even ConstraintMode.NO_CONSTRAINT present on the @ManyToOne side

(cherry picked from commit 633d0f08d6039c662437be6c83f9eaef3dbcab71)
2021-02-01 18:03:47 -08:00
Yanming Zhou
96ead8aad6 HHH-14253 support ConstraintMode.PROVIDER_DEFAULT
Provide an option to skip foreign key creation for ConstraintMode.PROVIDER_DEFAULT

(cherry picked from commit 88acc9511b2e1c1cee7def27ba8dc717a8c321f8)
2021-02-01 17:59:25 -08:00
Gail Badner
95ff7ae28a HHH-13944 : Added "join fetch" and one-to-many test cases
(cherry picked from commit 0e75b4f3b596260fd6bc4cbb9fe6658f0c4d3d3e)
2021-02-01 14:21:04 -08:00
Andrea Boriero
5b0e4345e2 HHH-13944 HQL/JPQL size() does not work (anymore) with nested expression
(cherry picked from commit 20008b19bc5bdc5dc2bedd14c96b425266b250c9)
2021-02-01 14:21:04 -08:00
Andrea Boriero
32f8de5b3e HHH-13944 Add test for issue
(cherry picked from commit c99904a60601e6c92dadf1db22d4f61a1be409da)
2021-02-01 14:21:04 -08:00
Sanne Grinovero
138c808f6f HHH-14428 Could avoid allocating an org.hibernate.internal.SessionFactoryImpl when no options are set 2021-02-01 22:10:24 +00:00
Sanne Grinovero
0fce600c17 HHH-14386 Fails to boot if provided CurrentTenantIdentifierResolver is unable to operate during bootstrap 2021-02-01 22:01:02 +00:00
Joseph B. Ottinger
aa31fba01b Updating refs to current IDEA and Eclipse integration docs 2021-02-01 21:54:12 +00:00
Alexander Iskuskov
b1ea0c1512 HHH-14421 Fix javadoc for Query.stream() method 2021-02-01 21:44:19 +00:00
Sanne Grinovero
2e016e119d HHH-14418 Revert to previous semantics: EventListenerGroup#clear() to also get rid of the default DuplicationStrategy 2021-01-28 22:19:07 +00:00
Sanne Grinovero
b257e6db25 HHH-14418 Reduce memory retention of each EventListenerGroup 2021-01-26 10:14:21 +00:00
Sanne Grinovero
a5b194dadd HHH-14415 Upgrade to Jandex 2.2.3.Final 2021-01-24 15:05:48 +00:00
Yoann Rodière
5c86f12675 HHH-14404 Remove check for concurrent execution of LogicalConnectionManagedImpl#releaseConnection
It's unlikely to ever happen, and even if it happened, the resulting
exception would probably be rather clear about the fact that the problem
is related to concurrent execution (ConcurrentModificationException
thrown by a Map of resources, for example).

See
https://github.com/hibernate/hibernate-orm/pull/3693#discussion_r560393293

Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-20 10:05:47 +00:00
Yoann Rodière
afd3758823 HHH-14404 Test setting the connection handling mode through SessionBuilder
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-20 10:05:40 +00:00
Yoann Rodière
524fafd7e9 HHH-14404 Take into account the connectionHandlingMode passed through SessionBuilder
Signed-off-by: Yoann Rodière <yoann@hibernate.org>
2021-01-20 10:05:34 +00:00
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 602926bf9bd4eafa54771d22846eb02946cccd91)
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 0c974991f7a75f45b2f881539f34eac890d6a191)
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