From 0c0ea8897e64461b1cfa9cd86a939b48f0bdd640 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 3 Dec 2022 15:28:06 +0300 Subject: Initial PostgreSQL schema and profile --- src/main/java/com/juick/service/PushQueriesServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/juick/service/PushQueriesServiceImpl.java') diff --git a/src/main/java/com/juick/service/PushQueriesServiceImpl.java b/src/main/java/com/juick/service/PushQueriesServiceImpl.java index a542087b..7f066ad7 100644 --- a/src/main/java/com/juick/service/PushQueriesServiceImpl.java +++ b/src/main/java/com/juick/service/PushQueriesServiceImpl.java @@ -18,6 +18,7 @@ package com.juick.service; import org.apache.commons.collections4.CollectionUtils; +import org.springframework.dao.DataIntegrityViolationException; import org.springframework.dao.DuplicateKeyException; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; import org.springframework.stereotype.Repository; @@ -134,7 +135,7 @@ public class PushQueriesServiceImpl extends BaseJdbcService implements PushQueri try { return getJdbcTemplate().update("INSERT INTO ios(user_id,token) VALUES (?, ?)", uid, token) > 0; - } catch (DuplicateKeyException e) { + } catch (DataIntegrityViolationException e) { return true; } } -- cgit v1.2.3