From dev-return-15444-archive-asf-public=cust-asf.ponee.io@syncope.apache.org Thu Apr 12 16:22:16 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id CA2CC180634 for ; Thu, 12 Apr 2018 16:22:15 +0200 (CEST) Received: (qmail 49930 invoked by uid 500); 12 Apr 2018 14:22:14 -0000 Mailing-List: contact dev-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list dev@syncope.apache.org Received: (qmail 49915 invoked by uid 99); 12 Apr 2018 14:22:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Apr 2018 14:22:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1BCBCE09E2; Thu, 12 Apr 2018 14:22:14 +0000 (UTC) From: IsurangaPerera To: dev@syncope.apache.org Reply-To: dev@syncope.apache.org References: In-Reply-To: Subject: [GitHub] syncope pull request #70: [SYNCOPE-1301] fixed Content-Type: text/plain Message-Id: <20180412142214.1BCBCE09E2@git1-us-west.apache.org> Date: Thu, 12 Apr 2018 14:22:14 +0000 (UTC) Github user IsurangaPerera commented on a diff in the pull request: https://github.com/apache/syncope/pull/70#discussion_r181099396 --- Diff: core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java --- @@ -135,11 +135,7 @@ accessToken.setAuthorities(authorities); } - accessTokenDAO.save(accessToken); - } - - if (replaceExisting && existing != null) { - accessTokenDAO.delete(existing); + accessTokenDAO.merge(accessToken); --- End diff -- Actually that way there can be 2 tokens at a given moment. Suppose there exist an access token already. when trying to replace it in the old way it creates and saves another token (at this time there is 2 token which is against the unique constraint). ---