Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring integration lock is not working after upgrading to 6.2.x from 5.5.x #9050

Closed
YiyiSmile opened this issue Mar 25, 2024 · 2 comments
Closed

Comments

@YiyiSmile
Copy link

In what version(s) of Spring Integration are you seeing this issue?

6.2.3

Describe the bug

We use the spring integration distribution lock feature on our DB2 database. The lock table is created on DB2. Previously it was working well with spring boot 2.7.x and spring integration 5.5.x. But lately we upgrade springboot from 2.7.x to 3.x, the spring integration also got upgraded to 6.2.x, then when we run our application, we notice this issue - the update to the lock table is failed with 'bad SQL GRAMMER' error. Dig further,w e can see the log shows 'Invalida data conversion: Parameter instance instance 2024-03-25T07:43:xxxx is invalid for the requested conversion. ERRORCODE = -4461, SQLSTATE = 42851.

We digged the issue a bit, and found that the issue has nothing to do with spring-integration-core, but caused by spring-integration-jdbc. Because when we change our pom file, keep spring-integration-core at version 6.2.x, only downgrade spring-integration-jdbc to previous 5.5.x version, the issue was gone.

To Reproduce

The reproduce step is quite straightforward, prepare the DB2 environment, create the lock table, then write a springboot application with version 3.x to call the lock-obtaining method, then the issue will occur.

Expected behavior

Obtain the lock successfully.

Sample

@YiyiSmile YiyiSmile added status: waiting-for-triage The issue need to be evaluated and its future decided type: bug labels Mar 25, 2024
@artembilan
Copy link
Member

Can we see the whole stack trace for the error?
It feels like DB2 driver does not support conversion from the LocalDateTime into TIMESTAMP: https://stackoverflow.com/questions/60467668/persist-a-localdatetime-into-a-db2-timestamp-column.

Apparently we need to convert it back to the java.sql.Timestamp.

Will be fixed shortly...

@artembilan artembilan added this to the 6.3.0-RC1 milestone Mar 25, 2024
spring-builds pushed a commit that referenced this issue Mar 25, 2024
Fixes: #9050

Turns out not all JDBC drivers support a `LocalDateTime` type conversion.

* Use `Timestamp.valueOf(LocalDateTime)` for `TIMESTAMP` params of the queries
in the `DefaultLockRepository`

(cherry picked from commit f71a223)
spring-builds pushed a commit that referenced this issue Mar 25, 2024
Fixes: #9050

Turns out not all JDBC drivers support a `LocalDateTime` type conversion.

* Use `Timestamp.valueOf(LocalDateTime)` for `TIMESTAMP` params of the queries
in the `DefaultLockRepository`

(cherry picked from commit f71a223)
@artembilan
Copy link
Member

Have just pushed the fix.
Any chances that you can test it against 6.2.4-SNAPSHOT?
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants