From 33bac0f7c214bf63a36639084551b00642d341f9 Mon Sep 17 00:00:00 2001 From: Alexey Makarov Date: Wed, 20 Oct 2021 08:29:41 +0700 Subject: [PATCH] JdbcOAuth2AuthorizationService now uses LobCreator in findBy method Closes gh-455 --- .../authorization/JdbcOAuth2AuthorizationService.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationService.java b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationService.java index cab71441..d2b46602 100644 --- a/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationService.java +++ b/oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/JdbcOAuth2AuthorizationService.java @@ -253,9 +253,12 @@ public class JdbcOAuth2AuthorizationService implements OAuth2AuthorizationServic } private OAuth2Authorization findBy(String filter, List parameters) { - PreparedStatementSetter pss = new ArgumentPreparedStatementSetter(parameters.toArray()); - List result = this.jdbcOperations.query(LOAD_AUTHORIZATION_SQL + filter, pss, this.authorizationRowMapper); - return !result.isEmpty() ? result.get(0) : null; + try (LobCreator lobCreator = getLobHandler().getLobCreator()) { + PreparedStatementSetter pss = new LobCreatorArgumentPreparedStatementSetter(lobCreator, + parameters.toArray()); + List result = getJdbcOperations().query(LOAD_AUTHORIZATION_SQL + filter, pss, getAuthorizationRowMapper()); + return !result.isEmpty() ? result.get(0) : null; + } } /**