Skip to content

Commit 8213667

Browse files
committed
Merge remote-tracking branch 'upstream/main' into main-perf
2 parents b860887 + a9414fa commit 8213667

File tree

405 files changed

+10551
-4574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

405 files changed

+10551
-4574
lines changed

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ stage('Configure') {
5454

5555
if ( env.CHANGE_ID ) {
5656
if ( pullRequest.labels.contains( 'cockroachdb' ) ) {
57-
this.environments.add( new BuildEnvironment( dbName: 'cockroachdb', node: 'LongDuration', longRunning: true ) )
57+
this.environments.add( new BuildEnvironment( dbName: 'cockroachdb', node: 'cockroachdb', longRunning: true ) )
5858
}
5959
if ( pullRequest.labels.contains( 'hana' ) ) {
6060
this.environments.add( new BuildEnvironment( dbName: 'hana_cloud', dbLockableResource: 'hana-cloud', dbLockResourceAsHost: true ) )
@@ -237,7 +237,7 @@ stage('Build') {
237237
break;
238238
case "cockroachdb":
239239
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
240-
docker.image('cockroachdb/cockroach:v22.1.10').pull()
240+
docker.image('cockroachdb/cockroach:v22.2.2').pull()
241241
}
242242
sh "./docker_db.sh cockroachdb"
243243
state[buildEnv.tag]['containerName'] = "cockroach"

ci/jpa-3.1-tck.Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ pipeline {
2121
}
2222
parameters {
2323
choice(name: 'IMAGE_JDK', choices: ['jdk11'], description: 'The JDK base image version to use for the TCK image.')
24-
string(name: 'TCK_VERSION', defaultValue: '3.1.0', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
25-
string(name: 'TCK_SHA', defaultValue: '21441d1b1ec04fb696febcb897beb103cfee8d7d50137fec7c564e32626d9941', description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.0/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
24+
string(name: 'TCK_VERSION', defaultValue: '3.1.1', description: 'The version of the Jakarta JPA TCK i.e. `2.2.0` or `3.0.1`')
25+
string(name: 'TCK_SHA', defaultValue: 'b954b39440b331eb4584187d2d8245f82c4d2aa8b02d2e04bd42498a5751312b', description: 'The SHA256 of the Jakarta JPA TCK that is distributed under https://download.eclipse.org/jakartaee/persistence/3.1/jakarta-persistence-tck-${TCK_VERSION}.zip.sha256')
2626
booleanParam(name: 'NO_SLEEP', defaultValue: true, description: 'Whether the NO_SLEEP patch should be applied to speed up the TCK execution')
2727
}
2828
stages {

docker_db.sh

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ oracle_setup() {
451451
# We increase file sizes to avoid online resizes as that requires lots of CPU which is restricted in XE
452452
$CONTAINER_CLI exec oracle bash -c "source /home/oracle/.bashrc; bash -c \"
453453
cat <<EOF | \$ORACLE_HOME/bin/sqlplus / as sysdba
454+
set timing on
454455
-- Increasing redo logs
455456
alter database add logfile group 4 '\$ORACLE_BASE/oradata/XE/redo04.log' size 500M reuse;
456457
alter database add logfile group 5 '\$ORACLE_BASE/oradata/XE/redo05.log' size 500M reuse;
@@ -478,7 +479,7 @@ alter system set recyclebin=OFF sid='*' SCOPE=SPFILE;
478479
479480
-- Comment the 2 next lines to be able to use Diagnostics Pack features
480481
alter system set sga_target=0m sid='*' scope=both;
481-
alter system set statistics_level=BASIC sid='*' scope=spfile;
482+
-- alter system set statistics_level=BASIC sid='*' scope=spfile;
482483
483484
-- Restart the database
484485
SHUTDOWN IMMEDIATE;
@@ -641,7 +642,47 @@ hana() {
641642
}
642643

643644
cockroachdb() {
644-
cockroachdb_22_1
645+
cockroachdb_22_2
646+
}
647+
648+
cockroachdb_22_2() {
649+
$CONTAINER_CLI rm -f cockroach || true
650+
LOG_CONFIG="
651+
sinks:
652+
stderr:
653+
channels: all
654+
filter: ERROR
655+
redact: false
656+
exit-on-error: true
657+
"
658+
$CONTAINER_CLI run -d --name=cockroach -m 3g -p 26257:26257 -p 8080:8080 docker.io/cockroachdb/cockroach:v22.2.2 start-single-node \
659+
--insecure --store=type=mem,size=0.25 --advertise-addr=localhost --log="$LOG_CONFIG"
660+
OUTPUT=
661+
while [[ $OUTPUT != *"CockroachDB node starting"* ]]; do
662+
echo "Waiting for CockroachDB to start..."
663+
sleep 10
664+
# Note we need to redirect stderr to stdout to capture the logs
665+
OUTPUT=$($CONTAINER_CLI logs cockroach 2>&1)
666+
done
667+
echo "Enabling experimental box2d operators and some optimized settings for running the tests"
668+
#settings documented in https://www.cockroachlabs.com/docs/v22.1/local-testing.html#use-a-local-single-node-cluster-with-in-memory-storage
669+
$CONTAINER_CLI exec cockroach bash -c "cat <<EOF | ./cockroach sql --insecure
670+
SET CLUSTER SETTING sql.spatial.experimental_box2d_comparison_operators.enabled = on;
671+
SET CLUSTER SETTING kv.raft_log.disable_synchronization_unsafe = true;
672+
SET CLUSTER SETTING kv.range_merge.queue_interval = '50ms';
673+
SET CLUSTER SETTING jobs.registry.interval.gc = '30s';
674+
SET CLUSTER SETTING jobs.registry.interval.cancel = '180s';
675+
SET CLUSTER SETTING jobs.retention_time = '15s';
676+
SET CLUSTER SETTING sql.stats.automatic_collection.enabled = false;
677+
SET CLUSTER SETTING kv.range_split.by_load_merge_delay = '5s';
678+
ALTER RANGE default CONFIGURE ZONE USING "gc.ttlseconds" = 600;
679+
ALTER DATABASE system CONFIGURE ZONE USING "gc.ttlseconds" = 600;
680+
681+
quit
682+
EOF
683+
"
684+
echo "Cockroachdb successfully started"
685+
645686
}
646687

647688
cockroachdb_22_1() {
@@ -654,7 +695,7 @@ sinks:
654695
redact: false
655696
exit-on-error: true
656697
"
657-
$CONTAINER_CLI run -d --name=cockroach -m 3g -p 26257:26257 -p 8080:8080 docker.io/cockroachdb/cockroach:v22.1.11 start-single-node \
698+
$CONTAINER_CLI run -d --name=cockroach -m 3g -p 26257:26257 -p 8080:8080 docker.io/cockroachdb/cockroach:v22.1.13 start-single-node \
658699
--insecure --store=type=mem,size=0.25 --advertise-addr=localhost --log="$LOG_CONFIG"
659700
OUTPUT=
660701
while [[ $OUTPUT != *"CockroachDB node starting"* ]]; do
@@ -732,6 +773,7 @@ if [ -z ${1} ]; then
732773
echo "No db name provided"
733774
echo "Provide one of:"
734775
echo -e "\tcockroachdb"
776+
echo -e "\tcockroachdb_22_2"
735777
echo -e "\tcockroachdb_22_1"
736778
echo -e "\tcockroachdb_21_1"
737779
echo -e "\tdb2"

documentation/src/main/asciidoc/userguide/appendices/LegacyBasicTypeResolution.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ in <<basic-custom-type>>.
8585
[cols="<.^,<.^,<.^,<.^",options="header",]
8686
|=================================================================================================
8787
|Hibernate type (org.hibernate.type package) |JDBC type |Java type |BasicTypeRegistry key(s)
88-
|DURATION |INTERVAL_SECOND |java.time.Duration |Duration, java.time.Duration
88+
|DURATION |NUMERIC |java.time.Duration |Duration, java.time.Duration
8989
|INSTANT |TIMESTAMP_UTC |java.time.Instant |Instant, java.time.Instant
9090
|LOCAL_DATE_TIME |TIMESTAMP |java.time.LocalDateTime |LocalDateTime, java.time.LocalDateTime
9191
|LOCAL_DATE |DATE |java.time.LocalDate |LocalDate, java.time.LocalDate

documentation/src/main/asciidoc/userguide/chapters/domain/basic_types.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,9 @@ include::{sourcedir}/basic/BlobByteArrayTest.java[tags=basic-blob-byte-array-exa
980980

981981
==== Duration
982982

983-
By default, Hibernate will map `Duration` to the `INTERVAL_SECOND` SQL type and fallback to `NUMERIC` if necessary.
983+
By default, Hibernate maps `Duration` to the `NUMERIC` SQL type.
984+
985+
TIP: It's possible to map `Duration` to the `INTERVAL_SECOND` SQL type using `@JdbcType(INTERVAL_SECOND)` or by setting `hibernate.type.preferred_duration_jdbc_type=INTERVAL_SECOND`
984986

985987
[[basic-duration-example]]
986988
.Mapping Duration

documentation/src/main/asciidoc/userguide/chapters/locking/Locking.adoc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -374,25 +374,22 @@ If not supported, the Hibernate dialect ignores this query hint.
374374
The `jakarta.persistence.lock.scope` is https://hibernate.atlassian.net/browse/HHH-9636[not yet supported] as specified by the Jakarta Persistence standard.
375375
====
376376

377-
[[locking-buildLockRequest]]
378-
=== The `buildLockRequest` API
377+
[[locking-session-lock]]
378+
=== Session.lock()
379379

380-
Traditionally, Hibernate offered the `Session#lock()` method for acquiring an optimistic or a pessimistic lock on a given entity.
381-
Because varying the locking options was difficult when using a single `LockMode` parameter, Hibernate has added the `Session#buildLockRequest()` method API.
380+
The following example shows how to obtain a shared database lock.
382381

383-
The following example shows how to obtain a shared database lock without waiting for the lock acquisition request.
384-
385-
[[locking-buildLockRequest-example]]
386-
.`buildLockRequest` example
382+
[[locking-session-lock-example]]
383+
.`session.lock()` example
387384
====
388385
[source, JAVA,indent=0]
389386
----
390-
include::{sourcedir}/ExplicitLockingTest.java[tags=locking-buildLockRequest-example,indent=0]
387+
include::{sourcedir}/ExplicitLockingTest.java[tags=locking-session-lock-example,indent=0]
391388
----
392389
393390
[source, SQL,indent=0]
394391
----
395-
include::{extrasdir}/locking-buildLockRequest-example.sql[]
392+
include::{extrasdir}/locking-sessionlock-example.sql[]
396393
----
397394
====
398395

documentation/src/main/asciidoc/userguide/chapters/locking/extras/locking-buildLockRequest-example.sql

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
SELECT p1_0.id,
2+
p1_0."name"
3+
FROM Person p1_0
4+
WHERE p1_0.id = 1
5+
6+
SELECT id
7+
FROM Person
8+
WHERE id = 1
9+
FOR UPDATE

0 commit comments

Comments
 (0)