Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,7 @@ private DataSource resolveDataSource() {

private JdbcChatMemoryRepositoryDialect resolveDialect(DataSource dataSource) {
if (this.dialect == null) {
try {
return JdbcChatMemoryRepositoryDialect.from(dataSource);
}
catch (Exception ex) {
throw new IllegalStateException("Could not detect dialect from datasource", ex);
}
return JdbcChatMemoryRepositoryDialect.from(dataSource);
}
else {
warnIfDialectMismatch(dataSource, this.dialect);
Expand All @@ -236,15 +231,10 @@ private JdbcChatMemoryRepositoryDialect resolveDialect(DataSource dataSource) {
* from the DataSource.
*/
private void warnIfDialectMismatch(DataSource dataSource, JdbcChatMemoryRepositoryDialect explicitDialect) {
try {
JdbcChatMemoryRepositoryDialect detected = JdbcChatMemoryRepositoryDialect.from(dataSource);
if (!detected.getClass().equals(explicitDialect.getClass())) {
logger.warn("Explicitly set dialect {} will be used instead of detected dialect {} from datasource",
explicitDialect.getClass().getSimpleName(), detected.getClass().getSimpleName());
}
}
catch (Exception ex) {
logger.debug("Could not detect dialect from datasource", ex);
JdbcChatMemoryRepositoryDialect detected = JdbcChatMemoryRepositoryDialect.from(dataSource);
if (!detected.getClass().equals(explicitDialect.getClass())) {
logger.warn("Explicitly set dialect {} will be used instead of detected dialect {} from datasource",
explicitDialect.getClass().getSimpleName(), detected.getClass().getSimpleName());
}
}

Expand Down