Skip to content

Commit

Permalink
Merge pull request #40634 from gsmet/3.10.1-backports-2
Browse files Browse the repository at this point in the history
[3.10] 3.10.1 backports 2
  • Loading branch information
gsmet authored May 15, 2024
2 parents 22f1cb6 + d54eb0d commit 0275783
Show file tree
Hide file tree
Showing 24 changed files with 1,256 additions and 32 deletions.
8 changes: 4 additions & 4 deletions bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<opentelemetry-alpha.version>1.32.0-alpha</opentelemetry-alpha.version>
<opentelemetry-semconv.version>1.21.0-alpha</opentelemetry-semconv.version> <!-- keep in sync with opentelemetry-java-instrumentation in the alpha bom-->
<quarkus-http.version>5.2.2.Final</quarkus-http.version>
<micrometer.version>1.12.4</micrometer.version><!-- keep in sync with hdrhistogram -->
<micrometer.version>1.12.5</micrometer.version><!-- keep in sync with hdrhistogram -->
<hdrhistogram.version>2.1.12</hdrhistogram.version><!-- keep in sync with micrometer -->
<google-auth.version>0.22.0</google-auth.version>
<graphql-java.version>21.3</graphql-java.version> <!-- keep in sync with smallrye-graphql -->
Expand All @@ -55,9 +55,9 @@
<smallrye-health.version>4.1.0</smallrye-health.version>
<smallrye-metrics.version>4.0.0</smallrye-metrics.version>
<smallrye-open-api.version>3.10.0</smallrye-open-api.version>
<smallrye-graphql.version>2.8.3</smallrye-graphql.version>
<smallrye-graphql.version>2.8.4</smallrye-graphql.version>
<smallrye-fault-tolerance.version>6.3.0</smallrye-fault-tolerance.version>
<smallrye-jwt.version>4.5.1</smallrye-jwt.version>
<smallrye-jwt.version>4.5.2</smallrye-jwt.version>
<smallrye-context-propagation.version>2.1.0</smallrye-context-propagation.version>
<smallrye-reactive-streams-operators.version>1.0.13</smallrye-reactive-streams-operators.version>
<smallrye-reactive-types-converter.version>3.0.1</smallrye-reactive-types-converter.version>
Expand Down Expand Up @@ -139,7 +139,7 @@
<shrinkwrap.version>1.2.6</shrinkwrap.version>
<hamcrest.version>2.2</hamcrest.version><!-- The version needs to be compatible with both REST Assured and Awaitility -->
<junit.jupiter.version>5.10.2</junit.jupiter.version>
<infinispan.version>15.0.2.Final</infinispan.version>
<infinispan.version>15.0.3.Final</infinispan.version>
<infinispan.protostream.version>5.0.3.Final</infinispan.protostream.version>
<caffeine.version>3.1.5</caffeine.version>
<netty.version>4.1.108.Final</netty.version>
Expand Down
78 changes: 78 additions & 0 deletions docs/src/main/asciidoc/datasource.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,84 @@ public class MyProducer {
----
====

[[datasource-multiple-single-transaction]]
=== Use multiple datasources in a single transaction

By default, XA support on datasources is disabled,
and thus a transaction may include at most one datasource.
Attempting to access multiple non-XA datasources in the same transaction
would result in an exception similar to this:

[source]
----
...
Caused by: java.sql.SQLException: Exception in association of connection to existing transaction
at io.agroal.narayana.NarayanaTransactionIntegration.associate(NarayanaTransactionIntegration.java:130)
...
Caused by: java.sql.SQLException: Unable to enlist connection to existing transaction
at io.agroal.narayana.NarayanaTransactionIntegration.associate(NarayanaTransactionIntegration.java:121)
...
----

To allow using multiple JDBC datasources in the same transaction:

. Make sure your JDBC driver supports XA.
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`.

Using XA, a rollback in one datasource will trigger a rollback in every other datasource enrolled in the transaction.

[NOTE]
====
XA transactions on reactive datasources are not supported at the moment.
====

[NOTE]
====
If your transaction involves other, non-datasource resources,
keep in mind *those* resources might not support XA transactions,
or might require additional configuration.
====

If XA cannot be enabled for one of your datasources:

* Be aware that enabling XA for all datasources _except one_ (and only one) is still supported
through https://www.narayana.io/docs/project/index.html#d5e857[Last Resource Commit Optimization (LRCO)].
* If you do not need a rollback for one datasource to trigger a rollback for other datasources,
consider splitting your code into multiple transactions.
To that end, use xref:transaction.adoc#programmatic-approach[`QuarkusTransaction.requiringNew()`]/xref:transaction.adoc#declarative-approach[`@Transactional(REQUIRES_NEW)`] (preferably)
or xref:transaction.adoc#legacy-api-approach[`UserTransaction`] (for more complex use cases).

[CAUTION]
====
As a last resort, and for compatibility with Quarkus 3.8 and earlier,
you may allow unsafe transaction handling across multiple non-XA datasources
by setting `quarkus.transaction-manager.unsafe-multiple-last-resources` to `allow`.
With this property set to `allow`, a transaction rollback
could possibly be applied to only some of the non-XA datasources,
with other non-XA datasources having already committed their changes,
leaving your overall system in an inconsistent state.
Alternatively, you can allow the same unsafe behavior,
but with warnings when it is taken advantage of:
* setting the property to `warn-each`
would result in logging a warning on *each* offending transaction.
* setting the property to `warn-first`
would result in logging a warning on the *first* offending transaction.
We do not recommend using this configuration property,
and we plan to remove it in the future,
so you should plan fixing your application accordingly.
If you think your use case of this feature is valid and this option should be kept around,
open an issue in the https://github.com/quarkusio/quarkus/issues/new?assignees=&labels=kind%2Fenhancement&projects=&template=feature_request.yml[Quarkus tracker]
explaining why.
====

== Datasource integrations

=== Datasource health check
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/infinispan-client-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -748,8 +748,8 @@ When a method annotated with `@CacheInvalidateAll` is invoked, Infinispan will r
== Querying

The Infinispan client supports both indexed and non-indexed search as long as the
`ProtoStreamMarshaller` is configured above. This allows the user to query based on the
properties of the proto schema. *Indexed queries are preferred for performance reasons*.
`ProtoStreamMarshaller` is configured above. This allows the user to query on *keys* or
*values* based on the properties of the proto schema. *Indexed queries are preferred for performance reasons*.

.XML
[source,xml,options="nowrap",subs=attributes+,role="primary"]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/javascript/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(tables){
var input = caption.firstElementChild.lastElementChild;
input.addEventListener("keyup", initiateSearch);
input.addEventListener("input", initiateSearch);
input.attributes.removeNamedItem('disabled');
if (input.attributes.disabled) input.attributes.removeNamedItem('disabled');
inputs[input.id] = {"table": table};
}

Expand Down
Loading

0 comments on commit 0275783

Please sign in to comment.