You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#8623
Turns out not all JDBC drivers (or RDBMS vendors) support `java.time.Instant`
mapping to their `TIMESTAMP` type.
For example the PostgreSQL fails like:
```
org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of java.time.Instant.
```
* Use `LocalDateTime.now(ZoneOffset.UTC)` instead `Instant.now()`.
Essentially bringing back the behavior from the previous version
Copy file name to clipboardExpand all lines: spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/lock/DefaultLockRepository.java
+16-8Lines changed: 16 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,8 @@
17
17
packageorg.springframework.integration.jdbc.lock;
18
18
19
19
importjava.time.Duration;
20
-
importjava.time.Instant;
20
+
importjava.time.LocalDateTime;
21
+
importjava.time.ZoneOffset;
21
22
importjava.util.UUID;
22
23
23
24
importjavax.sql.DataSource;
@@ -341,13 +342,13 @@ public boolean acquire(String lock) {
341
342
Booleanresult =
342
343
this.serializableTransactionTemplate.execute(
343
344
transactionStatus -> {
344
-
if (this.template.update(this.updateQuery, this.id, Instant.now(),
0 commit comments