Commit Graph

59 Commits

Author SHA1 Message Date
Juergen Hoeller 701e9e410f Polishing 2024-02-28 21:13:10 +01:00
Juergen Hoeller cb28e2a701 Polishing 2023-10-11 16:01:12 +02:00
Juergen Hoeller 0370aa6007 Do not close transactional Connection in doReleaseConnection
Closes gh-28133
2023-10-11 15:51:58 +02:00
Juergen Hoeller 9d7154901f Polishing
(cherry picked from commit 6e5af9dccb)
2023-08-06 14:50:24 +02:00
Juergen Hoeller ad61fb75da Polishing 2023-08-02 01:24:11 +02:00
Juergen Hoeller 14c8c9168c Polishing 2023-07-26 14:02:05 +02:00
Juergen Hoeller 6dea580145 Clarify DataAccessException/ScriptException declarations for R2DBC
Closes gh-30932

(cherry picked from commit 5bcf5c6f7c)
2023-07-24 11:35:23 +02:00
Juergen Hoeller dd16e012ba Clarify ReactiveTransactionManager exception declarations
Avoid misleading "throws TransactionException" declarations but preserve javadoc "@throws" notes for specific exceptions (with reactive propagation semantics).

Closes gh-30817
2023-07-05 12:15:05 +02:00
Juergen Hoeller 259bd5250d Consistent javadoc references to JdbcTransactionManager 2023-06-05 11:12:38 +02:00
Johnny Lim 4c351e811a Polish
See gh-29928
2023-02-09 09:55:19 +01:00
Sam Brannen 9067ccab2d Update copyright headers 2023-02-07 16:35:52 +01:00
danu 0851b0f72d Release R2DBC connection when cleanup fails in transaction
When using R2dbcTransactionManager, connection will not be released if
it encounters error while doing `afterCleanup` steps. As `afterCleanup`
can use a database connection when doing `setAutoCommit(true)`, it can
fail under some conditions where the connection is not reliable.

This leads to the Connection not being released.

This commit ensures that inner steps of the `doCleanupAfterCompletion`
are protected against errors, logging the errors and continuing the
cleanup until the last step, which releases the connection.

Backport of commit e050c37
See gh-29703
Closes gh-29925

Co-authored-by: Simon Baslé <sbasle@vmware.com>
2023-02-03 17:43:22 +01:00
Juergen Hoeller 42e7318cbb Polishing 2023-01-31 16:48:36 +01:00
Sam Brannen 90ea39cc6b Update copyright headers 2023-01-28 20:49:13 +01:00
Simon Baslé de53d77344 DatabaseClient uses SQL Supplier more lazily
This commit modifies the `DefaultDatabaseClient` implementation in order
to ensure lazier usage of the `Supplier<String>` passed to the sql
method (`DatabaseClient#sql(Supplier)`).

Since technically `DatabaseClient` is an interface that could have 3rd
party implementations, the lazyness expectation is only hinted at in the
`DatabaseClient#sql` javadoc.

Possible caveat: some log statements attempt to reflect the now lazily
resolved SQL string. Similarly, some exceptions can capture the SQL that
caused the issue if known. We expect that these always occur after the
execution of the statement has been attempted (see `ResultFunction`).
At this point the SQL string will be accessible and logs and exceptions
should reflect it as before. Keep an eye out for such strings turning
into `null` after this change, which would indicate the opposite.

Backport of d72df5ace4
See gh-29367
Closes gh-29887
2023-01-26 15:20:38 +01:00
Minsoo Cheong(Merlin) 4bd2531774 Fix R2dbcTransactionManager debug log: don't log a Mono (#29800)
When logging the current connection inside R2dbcTransactionManager
doBegin, the mono object was logged instead of the connection lambda
parameter.

Other similar debug-level logs do use the actual Connection object,
so this commit does the same.

Backport of gh-29800
Closes gh-29824
2023-01-16 11:30:35 +01:00
Juergen Hoeller 937ab5f4b2 Polishing (aligned with main) 2022-12-13 12:06:09 +01:00
Sam Brannen 41a6b7ec20 Update copyright headers for source code changed since August 2022
The changes in this commit were performed using the newly introduced
update_copyright_headers.sh script.
2022-12-03 17:23:21 -05:00
Sam Brannen a281d8c3fd Polishing 2022-11-04 16:24:59 +01:00
Mikk Raudvere 12cc8a9f07 Fix typos
Closes gh-29364
2022-10-21 09:35:38 +02:00
Juergen Hoeller 6f64cfd1e5 Test square brackets with index/key expressions
See gh-27925
2022-10-18 23:04:23 +02:00
Marc Wrobel bd3499671c Fix typos in test code
This commit fixes typos in test class names, test method names, and
test variable names.

Closes gh-28807
2022-07-13 16:24:11 +02:00
Marc Wrobel cfb39acc97 Fix and improve Javadoc in spring-r2dbc
See gh-28796
2022-07-13 13:42:16 +02:00
Juergen Hoeller ae70e3c81c Apply read-only enforcement after R2DBC transaction begin
Includes prepareTransactionalConnection variant aligned with JDBC DataSourceTransactionManager.

Closes gh-28610
2022-07-13 11:09:17 +02:00
hsteinmueller bde0931e51 Fix Javadoc for DatabaseClient
The documentation for DatabaseClient had misplaced double quotes in the
example on how to map a select statement to a row.

Closes gh-28520
2022-05-24 17:15:44 +02:00
Henning Poettker ed4e2289cd Support H2 1.4 & 2.0 in H2SequenceMaxValueIncrementer
Prior to this commit, H2SequenceMaxValueIncrementer only supported H2
database 1.4.

This commit updates H2SequenceMaxValueIncrementer's getSequenceQuery()
method so that the syntax used supports version 1.4 and 2.0 of the H2
database.

This commit also updates several test schemas so that they work with H2
1.4 and 2.0 as well as HSQL.

Closes gh-27870
2022-01-07 10:09:27 +01:00
Sam Brannen 48a507a993 Clean up warnings 2021-10-05 14:35:32 +02:00
Sam Brannen 96e4d3a530 Fail Gradle build for Javadoc warnings
In order to catch Javadoc errors in the build, we now enable the
`Xwerror` flag for the `javadoc` tool. In addition, we now use
`Xdoclint:syntax` instead of `Xdoclint:none` in order to validate
syntax within our Javadoc.

This commit fixes all resulting Javadoc errors and warnings.

This commit also upgrades to Undertow 2.2.12.Final and fixes the
artifact names for exclusions for the Servlet and annotations APIs.

The incorrect exclusion of the Servlet API resulted in the Servlet API
being on the classpath twice for the javadoc task, which resulted in the
following warnings in previous builds.

javadoc: warning - Multiple sources of package comments found for package "javax.servlet"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.http"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.descriptor"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.annotation"

Closes gh-27480
2021-09-29 14:02:37 +02:00
Sanghyuk Jung ac72277258 Fix duplicate "the" in Javadoc and XSD
See gh-27291
2021-08-19 08:44:03 +02:00
Sam Brannen 746b1b2fe1 Polishing 2021-05-23 18:27:31 +02:00
izeye ab2c78a9d5 Fix broken Javadoc tags
Closes gh-26967
2021-05-23 18:09:34 +02:00
Sam Brannen 4c642ccdcd Logically reorganize methods in ScriptUtils
See gh-26947
2021-05-18 14:56:49 +02:00
Sam Brannen fab7b1cebe Polish ScriptUtils internals in spring-r2dbc
See gh-26947
2021-05-18 14:29:18 +02:00
Sam Brannen d33545bdce Avoid duplicate comment processing in ScriptUtils in spring-r2dbc
See gh-26947
2021-05-17 13:15:44 +02:00
Sam Brannen e8e157ebf8 Polish ScriptUtils in spring-r2dbc 2021-05-17 12:49:46 +02:00
Sam Brannen 7f5904c68b Remove internal APIs from ScriptUtils in spring-r2dbc
Prior to this commit, many of the utility methods in ScriptUtils in
spring-r2dbc were public by accident: they were copied from ScriptUtils
in spring-jdbc without changing the visibility when spring-r2dbc was
introduced in Spring Framework. 5.3 GA.

This commit corrects this mistake by removing internal APIs from
ScriptUtils in spring-r2dbc from the public contract.

See gh-26947
2021-05-17 12:15:30 +02:00
Sam Brannen 66e488850b Ignore comments when searching for statement delimiter in ScriptUtils
This commit picks up where 569ce840cf left off, by correctly invoking
the new containsStatementSeparator(...) method from
executeSqlScript(...) in ScriptUtils in spring-r2dbc.

See gh-26911
2021-05-17 12:07:04 +02:00
Sébastien Deleuze 3dba3691a7 Upgrade to Coroutines 1.5.0
This commit upgrades to Coroutines 1.5.0 while retaining
Coroutines 1.4.x compatibility.

Closes gh-26897
2021-05-17 11:37:02 +02:00
Sam Brannen c80c4e001a Add missing author tags and sync SQL script support for JDBC & R2DBC 2021-05-16 17:18:56 +02:00
Sam Brannen 4cfad25468 Polish ScriptUtils implementations 2021-05-14 15:15:12 +02:00
Sam Brannen 569ce840cf Ignore comments when searching for statement delimiter in ScriptUtils
Prior to this commit, the implementations of
ScriptUtils.containsSqlScriptDelimiters() in spring-jdbc and
spring-r2dbc did not ignore comments when searching for the statement
delimiter within an SQL script. This resulted in subtle bugs if a
comment contained a single single-quote or single double-quote, since
the absence of the closing single-quote or double-quote led the
algorithm to believe that it was still "within a text literal". Similar
issues could arise if a comment contained the sought statement
delimiter but the rest of the script did not contain the sought
statement delimiter. In such cases, the algorithms in ScriptUtils could
erroneously choose an incorrect statement delimiter -- for example,
using the fallback statement delimiter instead of the delimiter
specified by the user.

This commit avoids such bugs by ignoring single-line comments and block
comments when searching for the statement delimiter within an SQL
script.

Closes gh-26911
2021-05-14 14:23:27 +02:00
Sam Brannen 84e56bb5d9 Sync ScriptUtilsUnitTests implementations to simplify maintenance 2021-05-12 12:54:35 +02:00
Sam Brannen 6f5e66f00c Add missing tests for multiple comment prefixes in R2DBC ScriptUtils
See gh-23289
2021-05-12 12:23:54 +02:00
Sam Brannen cda72e4a70 Ignore delimiter enclosed in double quotes in ScriptUtils
Prior to this commit, the containsSqlScriptDelimiters() method in
ScriptUtils ignored delimiters enclosed in single quotes but not those
enclosed within double quotes, which contradicts the algorithm in
splitSqlScript() and therefore constitutes a bug.

This commit fixes this bug in the ScriptUtils implementations in
spring-jdbc and spring-r2dbc.

Closes gh-26935
2021-05-12 12:07:55 +02:00
Mark Paluch 0eaf6d12eb
Add support for Oracle bind marker scheme using R2DBC
We now support Oracle's bind marker scheme that identifies dynamic
parameters using names that are prefixed with a colon such as
`:P0_myparam`.

Closes gh-26680
2021-03-15 11:26:15 +01:00
Сергей Цыпанов 0015fd6734 Improve URI/query strings sanitization 2020-11-04 16:28:51 +01:00
Sébastien Deleuze 4503260282 Fix Dokka warnings 2020-10-27 11:21:55 +01:00
Juergen Hoeller 41247d49ba R2DBC javadoc and code style revision
See gh-25065
2020-10-26 17:47:20 +01:00
Juergen Hoeller 16c8676e5b Use ConcurrentLruCache (aligned with NamedParameterJdbcTemplate)
See gh-24197
2020-10-26 17:37:20 +01:00
Sébastien Deleuze 3ed8813bbf Upgrade to Coroutines 1.4.0-M1 and use awaitSingle()
This commit raises the minimum Coroutines version supported
to 1.4.0-M1 and above, and changes usages of awaitFirst() or
awaitFirstOrNull() to awaitSingle() or awaitSingleOrNull()
to fix gh-25007.

Closes gh-25914
Closes gh-25007
2020-10-13 15:26:39 +02:00