Skip to content

Commit 58db7f5

Browse files
committed
Sync documentation of main branch
1 parent bf308ae commit 58db7f5

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

_versions/main/guides/datasource.adoc

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The `quarkus-jdbc-\*` and `quarkus-reactive-*-client` extensions provide build t
2727

2828
For more information about consuming and using a reactive datasource, see the Quarkus xref:reactive-sql-clients.adoc[Reactive SQL clients] guide.
2929

30-
Additionally, refer to the Quarkus xref:hibernate-orm.adoc[Hibernate ORM] guide for information on consuming and using a JDBC datasource.
30+
Additionally, refer to the Quarkus xref:hibernate-orm.adoc[Hibernate ORM] guide for information about consuming and using a JDBC datasource.
3131

3232

3333
== Get started with configuring `datasources` in Quarkus
@@ -190,7 +190,7 @@ It is possible to use JDBC and a reactive driver simultaneously.
190190

191191
JDBC is the most common database connection pattern, typically needed when used in combination with non-reactive Hibernate ORM.
192192

193-
. To use a JDBC datasource, start with adding the necessary dependencies:
193+
. To use a JDBC datasource, start by adding the necessary dependencies:
194194

195195
.. For use with a built-in JDBC driver, choose and add the Quarkus extension for your relational database driver from the list below:
196196
+
@@ -201,9 +201,9 @@ include::_includes/snip-note-derby.adoc[]
201201
+
202202
[NOTE]
203203
====
204-
H2 and Derby databases can be configured to run in "embedded mode"; however, the Derby extension does not support compiling the embedded database engine into native executables.
204+
You can configure H2 and Derby databases to run in "embedded mode"; however, the Derby extension does not support compiling the embedded database engine into native executables.
205205
206-
Read <<in-memory-databases,Testing with in-memory databases>> for suggestions regarding integration testing.
206+
For suggestions regarding integration testing, see <<in-memory-databases,Testing with in-memory databases>> .
207207
====
208208
* DB2 - `quarkus-jdbc-db2`
209209
* MariaDB - `quarkus-jdbc-mariadb`
@@ -225,10 +225,9 @@ For example, to add the PostgreSQL driver dependency:
225225
[NOTE]
226226
====
227227
Using a built-in JDBC driver extension automatically includes the Agroal extension, which is the JDBC connection pool implementation applicable for custom and built-in JDBC drivers.
228-
However, for custom drivers, Agroal needs to be added explicitly.
228+
However, for custom drivers, you must add Agroal explicitly.
229229
====
230230

231-
232231
.. For use with a custom JDBC driver, add the `quarkus-agroal` dependency to your project alongside the extension for your relational database driver:
233232
+
234233
[source,bash]
@@ -276,8 +275,7 @@ quarkus.datasource.username=scott
276275
quarkus.datasource.password=tiger
277276
----
278277

279-
For all the details about the JDBC configuration options and configuring other aspects,
280-
such as the connection pool size, refer to the <<jdbc-configuration,JDBC configuration reference>> section.
278+
For details about JDBC configuration options and configuring other aspects, such as the connection pool size, refer to the <<jdbc-configuration,JDBC configuration reference>> section.
281279

282280
===== Consuming the datasource
283281

@@ -303,7 +301,7 @@ Because this behavior is unexpected and can lead to data loss, an interceptor ro
303301
However, if you use XA transactions, the transaction manager handles the rollback.
304302

305303
If the behavior introduced in 3.18 causes issues for your workload, disable it by setting the `-Dquarkus-oracle-no-automatic-rollback-on-connection-close` system property to `true`.
306-
Make sure to report your use case in our link:https://github.com/quarkusio/quarkus/issues[issue tracker] so we can adjust this behavior if needed, for example, with more permanent settings.
304+
Make sure to report your use case in the link:https://github.com/quarkusio/quarkus/issues[issue tracker] so we can adjust this behavior if needed, for example, with more permanent settings.
307305

308306

309307
[[reactive-datasource]]
@@ -680,11 +678,12 @@ You can override this by setting the `transactions` configuration property:
680678
* `quarkus.datasource.jdbc.transactions` for default unnamed datasource
681679
* `quarkus.datasource._<datasource-name>_.jdbc.transactions` for named datasource
682680

683-
When a datasource is enabled for XA (by setting `quarkus.datasource[.optional name].jdbc.transactions to xa)` and the transaction recovery system is enabled (by setting the property `quarkus.transaction-manager.enable-recovery` to true) then the datasource is automatically registered for recovery. This is a safe default, but you can override this behaviour on a per-datasource basis by setting `quarkus.datasource.jdbc.enable-recovery`/`quarkus.datasource."datasource-name".jdbc.enable-recovery` to `false`. Only use this for advanced use cases and if you know recovery will not be necessary, otherwise it may result in data loss and/or data unavailability because resources may become locked indefinitely.
681+
When a datasource is enabled for XA (by setting `quarkus.datasource[.optional name].jdbc.transactions` to `xa`) and the transaction recovery system is enabled (by setting the property `quarkus.transaction-manager.enable-recovery` to `true`), then the datasource is automatically registered for recovery.
682+
This is a safe default, but you can override this behaviour on a per-datasource basis by setting `quarkus.datasource.jdbc.enable-recovery` or `quarkus.datasource."datasource-name".jdbc.enable-recovery` to `false`.
683+
Use only for advanced use cases and if you know recovery will not be necessary; otherwise it can result in data loss, data unavailability, or both, because resources can become locked indefinitely.
684684

685685
For more information, see the <<configuration-reference,Configuration reference>> section below.
686-
687-
To facilitate the storage of transaction logs in a database by using JDBC, see xref:transaction.adoc#jdbcstore[Configuring transaction logs to be stored in a datasource] section of the xref:transaction.adoc[Using transactions in Quarkus] guide.
686+
To facilitate the storage of transaction logs in a database by using JDBC, see the xref:transaction.adoc#jdbcstore[Configuring transaction logs to be stored in a datasource] section of the xref:transaction.adoc[Using transactions in Quarkus] guide.
688687

689688
==== Named datasources
690689

_versions/main/guides/logging.adoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,13 @@ For extension development, use `org.jboss.logging.Logger.getLogger(String)` inst
143143

144144
The injection of a configured `org.jboss.logging.Logger` logger instance with the `@Inject` annotation is another alternative to adding an application logger, but is applicable only to CDI beans.
145145

146-
You can use `@Inject Logger log`, where the logger gets named after the class you inject it to, or `@LoggerName("...") Logger log`, where the logger will receive the specified name. Notice, that `@Inject`
147-
is not required if you already annotated your `Logger` with `@LoggerName("...")`.
148-
146+
You can use `@Inject Logger log`, where the logger gets named after the class you inject it to, or `@LoggerName("...") Logger log`, where the logger receives the specified name.
147+
148+
[NOTE]
149+
====
150+
`@Inject` is not required if you already annotated your `Logger` with `@LoggerName("...")`.
151+
====
152+
149153
Once injected, you can use the `log` object to invoke logging methods.
150154

151155
.An example of two different types of logger injection:

_versions/main/guides/rest-data-panache.adoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,23 @@ public interface PeopleResource extends PanacheEntityResource<Person, Long> {
344344

345345
Additionally, if you are only interested in specifying the roles that are allowed to use the resources, the `@ResourceProperties` and `@MethodProperties` annotations have the field `rolesAllowed` to list the security roles permitted to access the resource or operation.
346346

347+
=== Using @Authenticated
348+
349+
Additionally, REST Data with Panache can be used in conjunction with `io.quarkus.security.Authenticated`, by either:
350+
351+
* Setting `@ResourceProperties(authenticated=true)` which results in all methods of the resource requiring authentication
352+
* The same result can also be achieved by adding the `@Authenticated` annotation on the interface instead of using the `authenticated` property
353+
* Finally, the `@Authenticated` annotation can be used on specific methods, meaning that only those will require an authenticated user. An example might look like so:
354+
355+
[source,java]
356+
----
357+
@ResourceProperties
358+
public interface PeopleResource extends PanacheEntityResource<Person, Long> {
359+
@Authenticated
360+
boolean delete(Long id);
361+
}
362+
----
363+
347364
== Query parameters to list entities
348365

349366
REST Data with Panache supports the following query parameters to get the list of entities:

0 commit comments

Comments
 (0)