Browse Source

fix bug #1397 Attempting to execute an operation on a closed EntityManager.

pull/1410/head
鄭脈龍 7 years ago
parent
commit
676451c73d
  1. 4
      openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2TokenRepository.java

4
openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2TokenRepository.java

@ -190,7 +190,7 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
TypedQuery<OAuth2AccessTokenEntity> query = manager.createNamedQuery(OAuth2AccessTokenEntity.QUERY_BY_NAME, OAuth2AccessTokenEntity.class);
query.setParameter(OAuth2AccessTokenEntity.PARAM_NAME, name);
List<OAuth2AccessTokenEntity> results = query.getResultList();
return results != null ? new HashSet<>(query.getResultList()) : new HashSet<>();
return results != null ? new HashSet<>(results) : new HashSet<>();
}
@Override
@ -198,7 +198,7 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
TypedQuery<OAuth2RefreshTokenEntity> query = manager.createNamedQuery(OAuth2RefreshTokenEntity.QUERY_BY_NAME, OAuth2RefreshTokenEntity.class);
query.setParameter(OAuth2RefreshTokenEntity.PARAM_NAME, name);
List<OAuth2RefreshTokenEntity> results = query.getResultList();
return results != null ? new HashSet<>(query.getResultList()) : new HashSet<>();
return results != null ? new HashSet<>(results) : new HashSet<>();
}
@Override

Loading…
Cancel
Save