Compare commits

...

9 Commits

Author SHA1 Message Date
Guillaume Smet 52c3f2c5f1
Merge 368e3dc81d into 3536fe9926 2024-05-19 11:08:24 +02:00
Guillaume Smet 3536fe9926
Merge pull request #40712 from aloubyansky/parallel-workspace-loader
Load workspace modules in parallel
2024-05-19 11:07:54 +02:00
Guillaume Smet 500638fdab
Merge pull request #40707 from quarkusio/dependabot/gradle/devtools/gradle/com.gradle.develocity-3.17.4
Bump com.gradle.develocity from 3.17.3 to 3.17.4 in /devtools/gradle
2024-05-19 11:06:34 +02:00
Sergey Beryozkin 2f0656ac6c
Merge pull request #40710 from quarkusio/dependabot/maven/wildfly-elytron.version-2.4.2.Final
Bump wildfly-elytron.version from 2.4.1.Final to 2.4.2.Final
2024-05-18 22:30:53 +01:00
Alexey Loubyansky 11e1e861f7 Load workspace modules in parallel 2024-05-18 10:22:22 +02:00
dependabot[bot] 5dfee0e8e9
Bump wildfly-elytron.version from 2.4.1.Final to 2.4.2.Final
Bumps `wildfly-elytron.version` from 2.4.1.Final to 2.4.2.Final.

Updates `org.wildfly.security:wildfly-elytron` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-ssh-util` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-auth-server` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-password-impl` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-realm` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-realm-token` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-realm-jdbc` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-realm-ldap` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-ssl` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-sasl-plain` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-sasl-digest` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-sasl-external` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-sasl-oauth2` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-sasl-scram` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-x500-cert` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-credential` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-sasl-gs2` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-asn1` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-sasl-gssapi` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-security-manager-action` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-auth` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-base` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-http` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-keystore` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-mechanism-digest` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-mechanism-gssapi` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-mechanism-oauth2` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-mechanism-scram` from 2.4.1.Final to 2.4.2.Final

Updates `org.wildfly.security:wildfly-elytron-mechanism` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-permission` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-provider-util` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-sasl` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-util` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-x500-cert-util` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

Updates `org.wildfly.security:wildfly-elytron-x500` from 2.4.1.Final to 2.4.2.Final
- [Commits](https://github.com/wildfly-security/wildfly-elytron/compare/2.4.1.Final...2.4.2.Final)

---
updated-dependencies:
- dependency-name: org.wildfly.security:wildfly-elytron
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-ssh-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-auth-server
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-password-impl
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-realm
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-realm-token
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-realm-jdbc
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-realm-ldap
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-ssl
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-sasl-plain
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-sasl-digest
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-sasl-external
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-sasl-oauth2
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-sasl-scram
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-x500-cert
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-credential
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-sasl-gs2
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-asn1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-sasl-gssapi
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-security-manager-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-http
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-keystore
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-mechanism-digest
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-mechanism-gssapi
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-mechanism-oauth2
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-mechanism-scram
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-mechanism
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-permission
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-provider-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-sasl
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-x500-cert-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.wildfly.security:wildfly-elytron-x500
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-17 21:52:24 +00:00
dependabot[bot] 5ec582abd7
Bump com.gradle.develocity from 3.17.3 to 3.17.4 in /devtools/gradle
Bumps com.gradle.develocity from 3.17.3 to 3.17.4.

---
updated-dependencies:
- dependency-name: com.gradle.develocity
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-17 19:32:33 +00:00
Guillaume Smet 368e3dc81d
Fix an invalid configuration property in datasource.adoc 2024-05-17 17:43:00 +02:00
Guillaume Smet 96d27a1532
Fix XA support for Oracle in native
We need to register a few more classes for reflection and also all their
nested classes, which is why I use `@RegisterForReflection` instead of
the usual build item.

Fixes #23341
2024-05-17 17:41:48 +02:00
7 changed files with 58 additions and 21 deletions

View File

@ -119,7 +119,7 @@
<slf4j-jboss-logmanager.version>2.0.0.Final</slf4j-jboss-logmanager.version>
<wildfly-common.version>1.7.0.Final</wildfly-common.version>
<wildfly-client-config.version>1.0.1.Final</wildfly-client-config.version>
<wildfly-elytron.version>2.4.1.Final</wildfly-elytron.version>
<wildfly-elytron.version>2.4.2.Final</wildfly-elytron.version>
<jboss-marshalling.version>2.1.4.SP1</jboss-marshalling.version>
<jboss-threads.version>3.6.1.Final</jboss-threads.version>
<vertx.version>4.5.7</vertx.version>

View File

@ -1,5 +1,5 @@
plugins {
id("com.gradle.develocity") version "3.17.3"
id("com.gradle.develocity") version "3.17.4"
}
develocity {

View File

@ -543,7 +543,7 @@ All <<extensions-and-database-drivers-reference,supported JDBC drivers do>>,
but <<other-databases,other JDBC drivers>> might not.
. Make sure your database server is configured to enable XA.
. Enable XA support explicitly for each relevant datasource by setting
<<quarkus-agroal_quarkus-datasource-jdbc-transactions,`quarkus.datasource[.optional name].transactions`>> to `xa`.
<<quarkus-agroal_quarkus-datasource-jdbc-transactions,`quarkus.datasource[.optional name].jdbc.transactions`>> to `xa`.
Using XA, a rollback in one datasource will trigger a rollback in every other datasource enrolled in the transaction.

View File

@ -2,6 +2,7 @@ package io.quarkus.jdbc.oracle.deployment;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.AdditionalIndexedClassesBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
/**
@ -14,7 +15,8 @@ public final class OracleNativeImage {
* by reflection, as commonly expected.
*/
@BuildStep
void reflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
void reflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass,
BuildProducer<AdditionalIndexedClassesBuildItem> additionalIndexedClasses) {
//Not strictly necessary when using Agroal, as it also registers
//any JDBC driver being configured explicitly through its configuration.
//We register it for the sake of people not using Agroal.
@ -23,6 +25,10 @@ public final class OracleNativeImage {
final String driverName = "oracle.jdbc.driver.OracleDriver";
reflectiveClass.produce(ReflectiveClassBuildItem.builder(driverName).build());
// This is needed when using XA and we use the `@RegisterForReflection` trick to make sure all nested classes are registered for reflection
additionalIndexedClasses
.produce(new AdditionalIndexedClassesBuildItem("io.quarkus.jdbc.oracle.runtime.graal.OracleReflections"));
// for ldap style jdbc urls. e.g. jdbc:oracle:thin:@ldap://oid:5000/mydb1,cn=OracleContext,dc=myco,dc=com
//
// Note that all JDK provided InitialContextFactory impls from the JDK registered via module descriptors

View File

@ -0,0 +1,13 @@
package io.quarkus.jdbc.oracle.runtime.graal;
import io.quarkus.runtime.annotations.RegisterForReflection;
/**
* We don't use a build item here as we also need to register all the nested classes and there's no way to do it easily with the
* build item for now.
*/
@RegisterForReflection(targets = { oracle.jdbc.xa.OracleXADataSource.class,
oracle.jdbc.datasource.impl.OracleDataSource.class })
public class OracleReflections {
}

View File

@ -8,9 +8,14 @@ import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Collection;
import java.util.Deque;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.concurrent.Phaser;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
import java.util.function.Function;
@ -41,6 +46,8 @@ public class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader
private static final String POM_XML = "pom.xml";
private static final Model MISSING_MODEL = new Model();
private static Path locateCurrentProjectPom(Path path) throws BootstrapMavenException {
Path p = path;
while (p != null) {
@ -53,11 +60,11 @@ public class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader
throw new BootstrapMavenException("Failed to locate project pom.xml for " + path);
}
private final List<RawModule> moduleQueue = new ArrayList<>();
private final Map<Path, Model> loadedPoms = new HashMap<>();
private final Deque<RawModule> moduleQueue = new ConcurrentLinkedDeque<>();
private final Map<Path, Model> loadedPoms = new ConcurrentHashMap<>();
private final Function<Path, Model> modelProvider;
private final Map<GAV, Model> loadedModules = new HashMap<>();
private final Map<GAV, Model> loadedModules = new ConcurrentHashMap<>();
private final LocalWorkspace workspace = new LocalWorkspace();
private final Path currentProjectPom;
@ -102,7 +109,7 @@ public class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader
private void addModulePom(Path pom) {
if (pom != null) {
moduleQueue.add(new RawModule(pom));
moduleQueue.push(new RawModule(pom));
}
}
@ -152,11 +159,22 @@ public class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader
};
}
int i = 0;
while (i < moduleQueue.size()) {
var newModules = new ArrayList<RawModule>();
while (i < moduleQueue.size()) {
loadModule(moduleQueue.get(i++), newModules);
while (!moduleQueue.isEmpty()) {
ConcurrentLinkedDeque<RawModule> newModules = new ConcurrentLinkedDeque<>();
while (!moduleQueue.isEmpty()) {
final Phaser phaser = new Phaser(1);
while (!moduleQueue.isEmpty()) {
phaser.register();
final RawModule module = moduleQueue.removeLast();
CompletableFuture.runAsync(() -> {
try {
loadModule(module, newModules);
} finally {
phaser.arriveAndDeregister();
}
});
}
phaser.arriveAndAwaitAdvance();
}
for (var newModule : newModules) {
newModule.process(processor);
@ -169,7 +187,7 @@ public class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader
return currentProject.get();
}
private void loadModule(RawModule rawModule, List<RawModule> newModules) {
private void loadModule(RawModule rawModule, Collection<RawModule> newModules) {
var moduleDir = rawModule.pom.getParent();
if (moduleDir == null) {
moduleDir = getFsRootDir();
@ -183,7 +201,7 @@ public class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader
rawModule.model = readModel(rawModule.pom);
}
loadedPoms.put(moduleDir, rawModule.model);
if (rawModule.model == null) {
if (rawModule.model == MISSING_MODEL) {
return;
}
@ -212,9 +230,8 @@ public class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader
parentDir = getFsRootDir();
}
if (!loadedPoms.containsKey(parentDir)) {
var parent = new RawModule(parentPom);
rawModule.parent = parent;
moduleQueue.add(parent);
rawModule.parent = new RawModule(parentPom);
moduleQueue.push(rawModule.parent);
}
}
}
@ -226,7 +243,7 @@ public class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader
private void queueModule(Path dir) {
if (!loadedPoms.containsKey(dir)) {
moduleQueue.add(new RawModule(dir.resolve(POM_XML)));
moduleQueue.push(new RawModule(dir.resolve(POM_XML)));
}
}
@ -273,7 +290,7 @@ public class WorkspaceLoader implements WorkspaceModelResolver, WorkspaceReader
// which we don't support in this workspace loader
log.warn("Module(s) under " + pom.getParent() + " will be handled as thirdparty dependencies because " + pom
+ " does not exist");
return null;
return MISSING_MODEL;
} catch (IOException e) {
throw new UncheckedIOException("Failed to load POM from " + pom, e);
}

View File

@ -3,6 +3,7 @@ quarkus.datasource.username=SYSTEM
quarkus.datasource.password=hibernate_orm_test
quarkus.datasource.jdbc.url=${oracledb.url}
quarkus.datasource.jdbc.max-size=1
quarkus.datasource.jdbc.transactions=xa
quarkus.hibernate-orm.database.generation=drop-and-create
quarkus.datasource.jdbc.additional-jdbc-properties."oracle.jdbc.timezoneAsRegion"=false