Skip to content

689 update to Vert.x 4.0.3 #694

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

Merged
merged 7 commits into from
Apr 12, 2021
Merged
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Latest Vert.x 3
name: Latest Vert.x 4.x

on:
# Trigger the workflow on push or pull request,
Expand All @@ -22,9 +22,8 @@ jobs:
strategy:
matrix:
example: [ 'session-example', 'native-sql-example' ]
orm-version: [ '[5.4,5.5)', '[5.5,5.6)' ]
db: [ 'MySQL', 'PostgreSQL' ]
vertx-version: [ '[3,4)' ]
vertx-version: [ '[4,5)' ]
exclude:
# 'native-sql-example' doesn't run on MySQL because it has native queries
- example: 'native-sql-example'
Expand Down Expand Up @@ -78,7 +77,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
vertx-version: ['[3,4)']
vertx-version: ['[4,5)']
db: [ 'MariaDB', 'MySQL', 'PostgreSQL', 'DB2', 'CockroachDB' ]
steps:
- uses: actions/checkout@v2
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ Hibernate Reactive has been tested with:
- Db2 11.5
- CockroachDB 20.2
- [Hibernate ORM][] 5.4.30.Final
- Vert.x 3.9.6
- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/)
- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/)
- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/)
- [Vert.x Reactive PostgreSQL Client](https://vertx.io/docs/vertx-pg-client/java/) 4.0.3
- [Vert.x Reactive MySQL Client](https://vertx.io/docs/vertx-mysql-client/java/) 4.0.3
- [Vert.x Reactive Db2 Client](https://vertx.io/docs/vertx-db2-client/java/) 4.0.3
- [Quarkus][Quarkus] via the Hibernate Reactive extension

Support for SQL Server is coming soon.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ext {
// Example:
// ./gradlew build -PvertxVersion=4.0.0-SNAPSHOT
if ( !project.hasProperty('vertxVersion') ) {
vertxVersion = '3.9.6'
vertxVersion = '4.0.3'
}

testcontainersVersion = '1.15.2'
Expand Down
2 changes: 1 addition & 1 deletion hibernate-reactive-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ tasks.withType(Test) {
defaultCharacterEncoding = "UTF-8"
testLogging {
displayGranularity 1
showStandardStreams = false
showStandardStreams = true
showStackTraces = true
exceptionFormat = 'full'
events 'PASSED', 'FAILED', 'SKIPPED'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@
*/
package org.hibernate.reactive.pool.impl;

import io.vertx.sqlclient.PropertyKind;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CompletionStage;

import org.hibernate.engine.jdbc.internal.FormatStyle;
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
import org.hibernate.reactive.adaptor.impl.ResultSetAdaptor;
import org.hibernate.reactive.pool.ReactiveConnection;

import io.vertx.sqlclient.Pool;
import io.vertx.sqlclient.PropertyKind;
import io.vertx.sqlclient.Row;
import io.vertx.sqlclient.RowIterator;
import io.vertx.sqlclient.RowSet;
Expand All @@ -15,16 +26,6 @@
import io.vertx.sqlclient.SqlResult;
import io.vertx.sqlclient.Transaction;
import io.vertx.sqlclient.Tuple;
import org.hibernate.engine.jdbc.internal.FormatStyle;
import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
import org.hibernate.reactive.adaptor.impl.ResultSetAdaptor;
import org.hibernate.reactive.pool.ReactiveConnection;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CompletionStage;

import static org.hibernate.reactive.util.impl.CompletionStages.voidFuture;

Expand Down Expand Up @@ -194,40 +195,25 @@ private void feedback(String sql) {
}

private SqlClient client() {
return transaction != null ? transaction : connection;
return connection;
}

@Override
public CompletionStage<Void> beginTransaction() {
transaction = connection.begin();
return voidFuture();
// return execute("begin");
return Handlers.<Transaction>toCompletionStage(connection::begin)
.thenAccept( tx -> transaction = tx );
}

@Override
public CompletionStage<Void> commitTransaction() {
return Handlers.toCompletionStage(
handler -> transaction.commit(
ar -> {
transaction = null;
handler.handle( ar );
}
)
);
// return execute("commit");
return Handlers.<Void>toCompletionStage(transaction::commit)
.whenComplete( (v, x) -> transaction = null );
}

@Override
public CompletionStage<Void> rollbackTransaction() {
return Handlers.toCompletionStage(
handler -> transaction.rollback(
ar -> {
transaction = null;
handler.handle( ar );
}
)
);
// return execute("rollback");
return Handlers.<Void>toCompletionStage(transaction::rollback)
.whenComplete( (v, x) -> transaction = null );
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@
import javax.persistence.Table;

import org.hibernate.cfg.Configuration;
import org.hibernate.reactive.testing.DatabaseSelectionRule;

import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import io.smallrye.mutiny.Uni;
import io.vertx.ext.unit.TestContext;

import static org.assertj.core.api.Assertions.assertThat;
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.DB2;
import static org.hibernate.reactive.testing.DatabaseSelectionRule.skipTestsFor;

/**
* Tests @{@link ElementCollection} on a {@link List} of basic types.
Expand All @@ -43,6 +47,9 @@
*/
public class EagerElementCollectionForBasicTypeListTest extends BaseReactiveTest {

@Rule
public DatabaseSelectionRule db2WithVertx4BugRule = skipTestsFor( DB2 );

private Person thePerson;

protected Configuration constructConfiguration() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,32 @@
*/
package org.hibernate.reactive;

import io.vertx.ext.unit.TestContext;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.cfg.Configuration;
import org.hibernate.reactive.testing.DatabaseSelectionRule;

import org.junit.After;
import org.junit.Rule;
import org.junit.Test;

import javax.persistence.*;
import java.util.Objects;
import io.vertx.ext.unit.TestContext;

import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.DB2;
import static org.hibernate.reactive.testing.DatabaseSelectionRule.skipTestsFor;
import static org.hibernate.reactive.util.impl.CompletionStages.completedFuture;

public class EagerOneToOneAssociationTest extends BaseReactiveTest {

@Rule
public DatabaseSelectionRule db2WithVertx4BugRule = skipTestsFor( DB2 );

@Override
protected Configuration constructConfiguration() {
Configuration configuration = super.constructConfiguration();
Expand Down
Loading