Skip to content

Conversation

@sunyuhan1998
Copy link
Contributor

As mentioned in the issue, the current implementation of JdbcChatMemoryRepositoryDialect#from has room for improvement in both exception handling and JDBC vendor detection logic. This PR refactors the method with the following changes:

  1. Rewrote the method to use org.springframework.jdbc.support.JdbcUtils#extractDatabaseMetaData for extracting database metadata from the dataSource, and obtain the database vendor name from the JDBC driver, improving accuracy and robustness;
  2. Enhanced exception handling: instead of silently ignoring exceptions, it now explicitly reports encountered issues, helping users identify problems and select the appropriate dialect more easily;
  3. All related unit tests have been executed and passed, ensuring that the changes do not introduce regressions.

Fixes #4289

…lect#from`

1. Rewrote the method to use `org.springframework.jdbc.support.JdbcUtils#extractDatabaseMetaData` for extracting database metadata from the `dataSource`, and obtain the database vendor name from the JDBC driver, improving accuracy and robustness;
2. Enhanced exception handling: instead of silently ignoring exceptions, it now explicitly reports encountered issues, helping users identify problems and select the appropriate dialect more easily;

Signed-off-by: Sun Yuhan <[email protected]>
Signed-off-by: Sun Yuhan <[email protected]>
Signed-off-by: Sun Yuhan <[email protected]>
Signed-off-by: Sun Yuhan <[email protected]>
@sunyuhan1998 sunyuhan1998 marked this pull request as draft September 2, 2025 03:14
Signed-off-by: Sun Yuhan <[email protected]>
@sunyuhan1998 sunyuhan1998 marked this pull request as ready for review September 2, 2025 03:26
@sobychacko sobychacko modified the milestone: 1.1.0.M1 Sep 3, 2025
@sobychacko
Copy link
Contributor

Merged upstream.

@sobychacko sobychacko closed this Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JdbcChatMemoryRepositoryDialect#from needs optimization

2 participants