Skip to content

Upgrade Vert.x SQL client to 4.5.9 #1967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# GitHub actions for branch testing the latest Hibernate ORM 6.6 snapshot
name: Hibernate Reactive CI

on:
push:
branches:
- main
tags:
- '2.*'
- 'wip/2.4'
pull_request:
branches: main
branches:
- 'wip/2.4'
schedule:
# * is a special character in YAML, so you have to quote this string
# Run every hour at minute 25
- cron: '25 * * * *'
# Allow running this workflow against a specific branch/tag
workflow_dispatch:

# See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting.
concurrency:
Expand Down Expand Up @@ -85,6 +91,8 @@ jobs:
with:
distribution: 'temurin'
java-version: 11
- name: Print the effective ORM version used
run: ./gradlew :${{ matrix.example }}:dependencyInsight --dependency org.hibernate.orm:hibernate-core
- name: Run examples in '${{ matrix.example }}' on ${{ matrix.db }}
run: ./gradlew :${{ matrix.example }}:runAllExamplesOn${{ matrix.db }}
- name: Upload reports (if build failed)
Expand Down Expand Up @@ -122,6 +130,8 @@ jobs:
with:
distribution: 'temurin'
java-version: 11
- name: Print the effective ORM version used
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core
- name: Build and Test with ${{ matrix.db }}
run: ./gradlew build -PshowStandardOutput -Pdocker -Pdb=${{ matrix.db }}
- name: Upload reports (if build failed)
Expand Down Expand Up @@ -200,6 +210,8 @@ jobs:
- name: Display exact version of JDK ${{ matrix.java.name }}
run: |
${{ steps.testjdk-exportpath.outputs.path }}/bin/java -version
- name: Print the effective ORM version used
run: ./gradlew :hibernate-reactive-core:dependencyInsight --dependency org.hibernate.orm:hibernate-core
- name: Build and Test with Java ${{ matrix.java.name }}
run: |
./gradlew build -PshowStandardOutput -Pdocker -Ptest.jdk.version=${{ matrix.java.java_version_numeric }} \
Expand All @@ -212,37 +224,25 @@ jobs:
name: reports-java${{ matrix.java.name }}
path: './**/build/reports/'

release:
name: Release
if: github.event_name == 'push' && startsWith( github.ref, 'refs/tags/' )
snapshot:
name: Create snapshot
if: github.event_name == 'push' && startsWith( github.ref, 'refs/heads/' )
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set git username and email
run: |
git config --global user.email "[email protected]"
git config --global user.name "hibernate"
- name: Set up JDK 11
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: 11
- name: Create artifacts
run: ./gradlew assemble
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.HIBERNATE_ORG_SSH_KEY }}
name: id_rsa_hibernate.org
known_hosts: ${{ secrets.HIBERNATE_ORG_SSH_KNOWN_HOSTS }}
config: |
Host github.com
User hibernate
IdentityFile ~/.ssh/id_rsa_hibernate.org
- name: Publish documentation on Hibernate.org
run: ./gradlew publishDocumentation -PdocPublishBranch=production
- name: Publish artifacts to OSSRH, close repository and release
env:
ORG_GRADLE_PROJECT_sonatypeOssrhUser: ${{ secrets.SONATYPE_OSSRH_USER }}
ORG_GRADLE_PROJECT_sonatypeOssrhPassword: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: 11
- name: Create artifacts
run: ./gradlew assemble
- name: Detect the version of Hibernate Reactive
id: detect-version
run: |
sed -E 's/^projectVersion( *= *| +)([^ ]+)/::set-output name=version::\2/g' gradle/version.properties
- name: Publish snapshots to OSSRH, close repository and release
env:
ORG_GRADLE_PROJECT_sonatypeOssrhUser: ${{ secrets.SONATYPE_OSSRH_USER }}
ORG_GRADLE_PROJECT_sonatypeOssrhPassword: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ Learn more at <http://hibernate.org/reactive>.

Hibernate Reactive has been tested with:

- Java 11, 17, 20, 21
- Java 11, 17, 20, 21, 22
- PostgreSQL 16
- MySQL 8
- MariaDB 11
- Db2 11
- CockroachDB v24
- MS SQL Server 2022
- Oracle 23
- [Hibernate ORM][] 6.5.2.Final
- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 4.5.8
- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 4.5.8
- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 4.5.8
- [Vert.x Reactive MS SQL Server Client](https://vertx.io/docs/vertx-mssql-client/java/) 4.5.8
- [Vert.x Reactive Oracle Client](https://vertx.io/docs/vertx-oracle-client/java/) 4.5.8
- [Hibernate ORM][] 6.6.0.CR2
- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 4.5.9
- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 4.5.9
- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 4.5.9
- [Vert.x Reactive MS SQL Server Client](https://vertx.io/docs/vertx-mssql-client/java/) 4.5.9
- [Vert.x Reactive Oracle Client](https://vertx.io/docs/vertx-oracle-client/java/) 4.5.9
- [Quarkus][Quarkus] via the Hibernate Reactive extension

[PostgreSQL]: https://www.postgresql.org
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ version = projectVersion
// ./gradlew clean build -PhibernateOrmVersion=5.6.15-SNAPSHOT
ext {
if ( !project.hasProperty('hibernateOrmVersion') ) {
hibernateOrmVersion = '6.5.2.Final'
hibernateOrmVersion = '6.6.0.CR2'
}
if ( !project.hasProperty( 'hibernateOrmGradlePluginVersion' ) ) {
// Same as ORM as default
Expand Down Expand Up @@ -83,7 +83,7 @@ ext {
// Example:
// ./gradlew build -PvertxSqlClientVersion=4.0.0-SNAPSHOT
if ( !project.hasProperty( 'vertxSqlClientVersion' ) ) {
vertxSqlClientVersion = '4.5.8'
vertxSqlClientVersion = '4.5.9'
}

testcontainersVersion = '1.19.8'
Expand Down
5 changes: 5 additions & 0 deletions examples/native-sql-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ buildscript {
// Useful for local development, it should be disabled otherwise
mavenLocal()
}
// Optional: Enables snapshots repository
// Example: ./gradlew build -PenableSonatypeOpenSourceSnapshotsRep
if ( project.hasProperty('enableSonatypeOpenSourceSnapshotsRep') ) {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
mavenCentral()
}
}
Expand Down
5 changes: 5 additions & 0 deletions examples/session-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ buildscript {
// Useful for local development, it should be disabled otherwise
mavenLocal()
}
// Optional: Enables snapshots repository
// Example: ./gradlew build -PenableSonatypeOpenSourceSnapshotsRep
if ( project.hasProperty('enableSonatypeOpenSourceSnapshotsRep') ) {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
mavenCentral()
}
}
Expand Down
16 changes: 9 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,29 @@ org.gradle.java.installations.auto-download=false
#db = MSSQL

# Enable the SonatypeOS maven repository (mainly for Vert.x snapshots) when present (value ignored)
#enableSonatypeOpenSourceSnapshotsRep = true
enableSonatypeOpenSourceSnapshotsRep = true

# Enable the maven local repository (for local development when needed) when present (value ignored)
#enableMavenLocalRepo = true

# Override default Hibernate ORM version
#hibernateOrmVersion = 6.5.2.Final
# I'm not setting a version window here, because the examples will end up using the latest stable version
# instead of the latest snapshot
hibernateOrmVersion = 6.6.0-SNAPSHOT

# Override default Hibernate ORM Gradle plugin version
# Using the stable version because I don't know how to configure the build to download the snapshot version from
# a remote repository
#hibernateOrmGradlePluginVersion = 6.5.2.Final
hibernateOrmGradlePluginVersion = 6.6.0.CR1

# If set to true, skip Hibernate ORM version parsing (default is true, if set to null)
# this is required when using intervals or weird versions or the build will fail
#skipOrmVersionParsing = true
skipOrmVersionParsing = true

# Override default Vert.x Sql client version
#vertxSqlClientVersion = 4.5.8-SNAPSHOT
#vertxSqlClientVersion = 4.5.9-SNAPSHOT

# Override default Vert.x Web client and server versions. For integration tests, both default to vertxSqlClientVersion
#vertxWebVersion = 4.5.8
#vertxWebtClientVersion = 4.5.8
#vertxWebVersion = 4.5.9
#vertxWebtClientVersion = 4.5.9

2 changes: 1 addition & 1 deletion gradle/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
projectVersion=2.3.2-SNAPSHOT
projectVersion=2.4.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,8 @@ public CompletionStage<Void> addAction(ReactiveEntityInsertAction action) {
return addInsertAction( action );
}

private CompletionStage<Void> addInsertAction( ReactiveEntityInsertAction insert) {
CompletionStage<Void> ret = voidFuture();
if ( insert.isEarlyInsert() ) {
// For early inserts, must execute inserts before finding non-nullable transient entities.
// TODO: find out why this is necessary
LOG.tracev( "Executing inserts before finding non-nullable transient entities for early insert: [{0}]", insert );
ret = ret.thenCompose( v -> executeInserts() );
}

return ret
private CompletionStage<Void> addInsertAction(ReactiveEntityInsertAction insert) {
return executeEarlyInsertsIfRequired( insert )
.thenCompose( v -> insert.reactiveFindNonNullableTransientEntities() )
.thenCompose( nonNullables -> {
if ( nonNullables == null ) {
Expand All @@ -270,40 +262,51 @@ private CompletionStage<Void> addInsertAction( ReactiveEntityInsertAction insert
} );
}

private CompletionStage<Void> executeEarlyInsertsIfRequired(ReactiveEntityInsertAction insert) {
if ( insert.isEarlyInsert() ) {
// For early inserts, must execute inserts before finding non-nullable transient entities.
// TODO: find out why this is necessary
LOG.tracev(
"Executing inserts before finding non-nullable transient entities for early insert: [{0}]",
insert
);
return executeInserts();
}
return voidFuture();
}

private CompletionStage<Void> addResolvedEntityInsertAction(ReactiveEntityInsertAction insert) {
CompletionStage<Void> ret;
if ( insert.isEarlyInsert() ) {
LOG.trace( "Executing insertions before resolved early-insert" );
ret = executeInserts()
.thenCompose( v -> {
// For early inserts, must execute inserts before finding non-nullable transient entities.
LOG.tracev( "Executing inserts before finding non-nullable transient entities for early insert: [{0}]", insert );
return executeInserts().thenCompose( v -> {
LOG.debug( "Executing identity-insert immediately" );
return execute( insert );
} );
} )
.thenCompose( v -> postResolvedEntityInsertAction( insert ) );
}
else {
LOG.trace( "Adding resolved non-early insert action." );
OrderedActions.EntityInsertAction.ensureInitialized( this );
this.insertions.add( new ReactiveEntityInsertActionHolder( insert ) );
ret = voidFuture();
return postResolvedEntityInsertAction( insert );
}
}

return ret.thenCompose( v -> {
if ( !insert.isVeto() ) {
CompletionStage<Void> comp = insert.reactiveMakeEntityManaged();
if ( unresolvedInsertions == null ) {
return comp;
}
else {
return comp.thenCompose( vv -> loop(
private CompletionStage<Void> postResolvedEntityInsertAction(ReactiveEntityInsertAction insert) {
if ( !insert.isVeto() ) {
return insert.reactiveMakeEntityManaged().thenCompose( v -> {
if ( unresolvedInsertions != null ) {
return loop(
unresolvedInsertions.resolveDependentActions( insert.getInstance(), session.getSharedContract() ),
resolvedAction -> addResolvedEntityInsertAction( (ReactiveEntityRegularInsertAction) resolvedAction )
) );
);
}
}
else {
throw new ReactiveEntityActionVetoException( "The ReactiveEntityInsertAction was vetoed.", insert );
}
} );
return voidFuture();
} );
}

throw new ReactiveEntityActionVetoException( "The ReactiveEntityInsertAction was vetoed.", insert );
}

private static String[] convertTimestampSpaces(Serializable[] spaces) {
Expand Down
Loading
Loading