Skip to content

Commit 069e586

Browse files
yrodieremarko-bekhta
authored andcommitted
HSEARCH-4791 Upgrade to Hibernate ORM 6.2.0.CR2
1 parent a94fd09 commit 069e586

File tree

13 files changed

+115
-51
lines changed

13 files changed

+115
-51
lines changed

build/configuration-properties-collector/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@
2626
<groupId>org.jsoup</groupId>
2727
<artifactId>jsoup</artifactId>
2828
</dependency>
29+
30+
<!-- This dependency is only here to solve javadoc warnings.
31+
For some reason, if we rely on the transitive dependency from mapper-orm,
32+
we end up with warnings like this:
33+
class file for jakarta.xml.bind.annotation.XmlAccessType not found
34+
Who knows what the exact reason is.
35+
-->
36+
<dependency>
37+
<groupId>jakarta.xml.bind</groupId>
38+
<artifactId>jakarta.xml.bind-api</artifactId>
39+
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
40+
<version>${version.jakarta.xml.bind}</version>
41+
<scope>provided</scope>
42+
</dependency>
2943
</dependencies>
3044

3145
<build>

integrationtest/java/modules/orm-coordination-outbox-polling-elasticsearch/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@
6262
<artifactId>${jdbc.driver.artifactId}</artifactId>
6363
<scope>test</scope>
6464
</dependency>
65+
<!-- For some reason jakarta.transaction-api requires CDI at runtime:
66+
https://github.com/jakartaee/transactions/pull/212 -->
67+
<dependency>
68+
<groupId>jakarta.enterprise</groupId>
69+
<artifactId>jakarta.enterprise.cdi-api</artifactId>
70+
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
71+
<version>${version.jakarta.enterprise}</version>
72+
<scope>test</scope>
73+
</dependency>
6574
</dependencies>
6675

6776
<build>

integrationtest/java/modules/orm-elasticsearch/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@
4949
<artifactId>${jdbc.driver.artifactId}</artifactId>
5050
<scope>test</scope>
5151
</dependency>
52+
<!-- For some reason jakarta.transaction-api requires CDI at runtime:
53+
https://github.com/jakartaee/transactions/pull/212 -->
54+
<dependency>
55+
<groupId>jakarta.enterprise</groupId>
56+
<artifactId>jakarta.enterprise.cdi-api</artifactId>
57+
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
58+
<version>${version.jakarta.enterprise}</version>
59+
<scope>test</scope>
60+
</dependency>
5261
</dependencies>
5362

5463
<build>

integrationtest/java/modules/orm-lucene/pom.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@
4444
<artifactId>${jdbc.driver.artifactId}</artifactId>
4545
<scope>test</scope>
4646
</dependency>
47+
<!-- For some reason jakarta.transaction-api requires CDI at runtime:
48+
https://github.com/jakartaee/transactions/pull/212 -->
49+
<dependency>
50+
<groupId>jakarta.enterprise</groupId>
51+
<artifactId>jakarta.enterprise.cdi-api</artifactId>
52+
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
53+
<version>${version.jakarta.enterprise}</version>
54+
<scope>test</scope>
55+
</dependency>
4756
</dependencies>
4857

4958
<build>

integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/proxy/ContainedInTriggerUnnecessaryCollectionInitializationIT.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
import org.hibernate.Hibernate;
2323
import org.hibernate.SessionFactory;
24-
import org.hibernate.annotations.LazyCollection;
25-
import org.hibernate.annotations.LazyCollectionOption;
2624
import org.hibernate.collection.spi.PersistentCollection;
2725
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField;
2826
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;
@@ -139,7 +137,8 @@ public static class Group {
139137
private int someInteger;
140138

141139
@OneToMany(mappedBy = "group")
142-
@LazyCollection(LazyCollectionOption.EXTRA)
140+
@SuppressWarnings("deprecation")
141+
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
143142
private Set<Post> posts = new HashSet<>();
144143

145144
public Integer getId() {

integrationtest/mapper/orm/src/test/java/org/hibernate/search/integrationtest/mapper/orm/automaticindexing/session/FlushClearEvictAllIT.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
import jakarta.persistence.OrderColumn;
2727
import jakarta.persistence.Table;
2828

29-
import org.hibernate.annotations.LazyCollection;
30-
import org.hibernate.annotations.LazyCollectionOption;
3129
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField;
3230
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;
3331
import org.hibernate.search.util.impl.integrationtest.common.rule.BackendMock;
@@ -131,7 +129,8 @@ public static class Post {
131129
private String name;
132130

133131
@OneToMany(mappedBy = "post", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
134-
@LazyCollection(LazyCollectionOption.EXTRA)
132+
@SuppressWarnings("deprecation")
133+
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
135134
@OrderColumn(name = "idx")
136135
private List<Comment> comments = new ArrayList<>();
137136

mapper/orm-batch-jsr352/core/pom.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,33 @@
4949
<artifactId>jakarta.batch-api</artifactId>
5050
</dependency>
5151

52+
<!-- This dependency is only here to solve Moditect errors.
53+
For some reason, the jakarta.transaction module requires jakarta.interceptor,
54+
but the jakarta.transaction-api Maven module doesn't depend on jakarta.interceptor-api,
55+
and that doesn't play well with Moditect, which ends up throwing an exception:
56+
Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: Module jakarta.interceptor not found, required by jakarta.transaction
57+
-->
58+
<dependency>
59+
<groupId>jakarta.interceptor</groupId>
60+
<artifactId>jakarta.interceptor-api</artifactId>
61+
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
62+
<version>${version.jakarta.interceptor-api}</version>
63+
<scope>provided</scope>
64+
</dependency>
65+
<!-- This dependency is only here to solve Moditect errors.
66+
For some reason, the jakarta.transaction module requires jakarta.cdi,
67+
but the jakarta.transaction-api Maven module doesn't depend on jakarta.enterprise.cdi-api,
68+
and that doesn't play well with Moditect, which ends up throwing an exception:
69+
Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: Module jakarta.interceptor not found, required by jakarta.transaction
70+
-->
71+
<dependency>
72+
<groupId>jakarta.enterprise</groupId>
73+
<artifactId>jakarta.enterprise.cdi-api</artifactId>
74+
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
75+
<version>${version.jakarta.enterprise}</version>
76+
<scope>provided</scope>
77+
</dependency>
78+
5279
<dependency>
5380
<groupId>org.hibernate.search</groupId>
5481
<artifactId>hibernate-search-util-internal-test-orm</artifactId>

mapper/orm-batch-jsr352/jberet/pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,6 @@
5454
<groupId>org.jboss.logging</groupId>
5555
<artifactId>jboss-logging-annotations</artifactId>
5656
</dependency>
57-
58-
<!-- This dependency is only here to solve javadoc warnings.
59-
For some reason, if we rely on the transitive dependency from mapper-orm,
60-
we end up with javadoc warnings like this:
61-
unknown enum constant XmlAccessType.FIELD
62-
This seems related to the annotation processor,
63-
but who knows what the exact reason is.
64-
-->
65-
<dependency>
66-
<groupId>jakarta.xml.bind</groupId>
67-
<artifactId>jakarta.xml.bind-api</artifactId>
68-
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
69-
<version>${version.jakarta.xml.bind}</version>
70-
<scope>provided</scope>
71-
</dependency>
7257
</dependencies>
7358

7459
<build>

mapper/orm-coordination-outbox-polling/pom.xml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,6 @@
2323
<groupId>org.hibernate.search</groupId>
2424
<artifactId>hibernate-search-mapper-orm</artifactId>
2525
</dependency>
26-
<!-- This dependency is only here to solve compilation warnings.
27-
For some reason, if we rely on the transitive dependency from mapper-orm,
28-
we end up with compilation warnings like this:
29-
unknown enum constant XmlAccessType.FIELD
30-
This seems related to the annotation processor,
31-
but who knows what the exact reason is.
32-
-->
33-
<dependency>
34-
<groupId>jakarta.xml.bind</groupId>
35-
<artifactId>jakarta.xml.bind-api</artifactId>
36-
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
37-
<version>${version.jakarta.xml.bind}</version>
38-
<scope>provided</scope>
39-
</dependency>
4026
<dependency>
4127
<groupId>org.jboss.logging</groupId>
4228
<artifactId>jboss-logging</artifactId>
@@ -49,6 +35,34 @@
4935
<groupId>org.apache.avro</groupId>
5036
<artifactId>avro</artifactId>
5137
</dependency>
38+
39+
<!-- This dependency is only here to solve Moditect errors.
40+
For some reason, the jakarta.transaction module requires jakarta.interceptor,
41+
but the jakarta.transaction-api Maven module doesn't depend on jakarta.interceptor-api,
42+
and that doesn't play well with Moditect, which ends up throwing an exception:
43+
Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: Module jakarta.interceptor not found, required by jakarta.transaction
44+
-->
45+
<dependency>
46+
<groupId>jakarta.interceptor</groupId>
47+
<artifactId>jakarta.interceptor-api</artifactId>
48+
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
49+
<version>${version.jakarta.interceptor-api}</version>
50+
<scope>provided</scope>
51+
</dependency>
52+
<!-- This dependency is only here to solve Moditect errors.
53+
For some reason, the jakarta.transaction module requires jakarta.cdi,
54+
but the jakarta.transaction-api Maven module doesn't depend on jakarta.enterprise.cdi-api,
55+
and that doesn't play well with Moditect, which ends up throwing an exception:
56+
Execution add-module-infos of goal org.moditect:moditect-maven-plugin:1.0.0.RC2:add-module-info failed: Module jakarta.interceptor not found, required by jakarta.transaction
57+
-->
58+
<dependency>
59+
<groupId>jakarta.enterprise</groupId>
60+
<artifactId>jakarta.enterprise.cdi-api</artifactId>
61+
<!-- DO NOT REMOVE and DO NOT MANAGE the version of this dependency. See the version property declaration. -->
62+
<version>${version.jakarta.enterprise}</version>
63+
<scope>provided</scope>
64+
</dependency>
65+
5266
<dependency>
5367
<groupId>org.hibernate.search</groupId>
5468
<artifactId>hibernate-search-util-internal-test-orm</artifactId>

mapper/orm-coordination-outbox-polling/src/main/java/org/hibernate/search/mapper/orm/coordination/outboxpolling/event/impl/OutboxEventLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ final class OutboxEventLoader implements ToStringTreeAppendable {
5050
// so we can afford to just skip events that are already locked,
5151
// and process them later when they are no longer locked.
5252
if ( dialect.supportsSkipLocked() ) {
53-
lockOptions = new LockOptions( LockMode.PESSIMISTIC_WRITE ).setTimeOut( LockOptions.SKIP_LOCKED );
53+
lockOptions = new LockOptions( LockMode.UPGRADE_SKIPLOCKED );
5454
}
5555
// If SKIP_LOCKED is not supported, we just do basic locking and hope for the best
5656
// (in particular we hope for transaction deadlocks to be detected by the database and result in a failure,

0 commit comments

Comments
 (0)