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 @@ -18,6 +18,7 @@
package org.keycloak.jgroups.protocol;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Objects;

import org.keycloak.connections.jpa.JpaConnectionProviderFactory;
Expand All @@ -36,8 +37,18 @@ protected void loadDriver() {
}

@Override
protected Connection getConnection() {
return factory.getConnection();
protected Connection getConnection() throws SQLException {
try {
return factory.getConnection();
} catch (Exception e) {
var cause = e.getCause();
if (cause instanceof SQLException sql) {
// it should hit this branch 100% of the time
throw sql;
}
//... but to be future proof ...
throw new SQLException(e);
}
}

public void setJpaConnectionProviderFactory(JpaConnectionProviderFactory factory) {
Expand Down
Loading