Skip to content
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

Document that Hibernate Reactive can now work with Agroal/Flyway and test HR + Flyway #36012

Merged
merged 3 commits into from
Sep 20, 2023
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
2 changes: 1 addition & 1 deletion .github/native-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{
"category": "Data7",
"timeout": 85,
"test-modules": "reactive-oracle-client, reactive-mysql-client, reactive-db2-client, hibernate-reactive-db2, hibernate-reactive-mysql, hibernate-reactive-mysql-agroal, hibernate-reactive-panache, hibernate-reactive-panache-kotlin",
"test-modules": "reactive-oracle-client, reactive-mysql-client, reactive-db2-client, hibernate-reactive-db2, hibernate-reactive-mysql, hibernate-reactive-mysql-agroal-flyway, hibernate-reactive-panache, hibernate-reactive-panache-kotlin",
"os-name": "ubuntu-latest"
},
{
Expand Down
6 changes: 0 additions & 6 deletions docs/src/main/asciidoc/hibernate-reactive.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,6 @@ it's not possible to configure multiple persistence units,
or even a single named persistence unit.
* This extension cannot be used at the same time as Hibernate ORM.
See https://github.com/quarkusio/quarkus/issues/13425.
* This extension cannot be used at the same time as JDBC/Agroal.
See https://github.com/quarkusio/quarkus/issues/33380.
+
This also means this extension cannot be used at the same time as extensions that rely on JDBC,
such as the Flyway extension.
See https://github.com/quarkusio/quarkus/issues/10716.
* Integration with the Envers extension is not supported.
* Transaction demarcation cannot be done using `jakarta.transaction.Transactional` or `QuarkusTransaction`;
if you use xref:hibernate-reactive-panache.adoc[Hibernate Reactive with Panache],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-flyway</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>quarkus-integration-test-hibernate-reactive-mysql-agroal</artifactId>
<name>Quarkus - Integration Tests - Hibernate Reactive - MySQL</name>
<description>Hibernate Reactive related tests running with the MySQL database</description>
<artifactId>quarkus-integration-test-hibernate-reactive-mysql-agroal-flyway</artifactId>
<name>Quarkus - Integration Tests - Hibernate Reactive - MySQL - With Agroal and Flyway</name>
<description>Hibernate Reactive related tests running with the MySQL database and also using Agroal and Flyway</description>

<properties>
<reactive-mysql.url>vertx-reactive:mysql://localhost:3306/hibernate_orm_test</reactive-mysql.url>
Expand Down Expand Up @@ -39,6 +39,14 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-jsonb</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-flyway</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>

<!-- test dependencies -->
<dependency>
Expand Down Expand Up @@ -118,6 +126,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-flyway-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# Reactive datasource config
quarkus.datasource.db-kind=mysql
quarkus.datasource.username=hibernate_orm_test
quarkus.datasource.password=hibernate_orm_test

# Hibernate config
#quarkus.hibernate-orm.log.sql=true
quarkus.hibernate-orm.database.generation=drop-and-create

# Reactive config
quarkus.datasource.reactive=true
quarkus.datasource.reactive.url=${reactive-mysql.url}

# Blocking datasource config
quarkus.datasource.blocking.db-kind=mysql
quarkus.datasource.blocking.username=hibernate_orm_test
quarkus.datasource.blocking.password=hibernate_orm_test
quarkus.datasource.blocking.jdbc.url=${mysql.jdbc.url}
quarkus.datasource.blocking.jdbc=true
quarkus.datasource.blocking.jdbc.max-size=1

# Hibernate config
#quarkus.hibernate-orm.log.sql=true
# We'll use Flyway
quarkus.hibernate-orm.database.generation=none

# Check that one can use Flyway alongside Hibernate Reactive
quarkus.flyway.blocking.migrate-at-start=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
create table Pig (
id integer not null,
name varchar(255),
primary key (id)
) engine=InnoDB;
2 changes: 1 addition & 1 deletion integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
<module>hibernate-orm-panache-kotlin</module>
<module>hibernate-reactive-db2</module>
<module>hibernate-reactive-mysql</module>
<module>hibernate-reactive-mysql-agroal</module>
<module>hibernate-reactive-mysql-agroal-flyway</module>
<module>hibernate-reactive-postgresql</module>
<module>hibernate-reactive-panache</module>
<module>hibernate-reactive-panache-kotlin</module>
Expand Down