aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service/PushQueriesServiceImpl.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-12-03 15:28:06 +0300
committerGravatar Vitaly Takmazov2022-12-14 12:57:52 +0300
commit0c0ea8897e64461b1cfa9cd86a939b48f0bdd640 (patch)
treef11c73b8246b0724b26ca08529c3c702e1722d79 /src/main/java/com/juick/service/PushQueriesServiceImpl.java
parent8344ea3e3e652f5307ffb6115d6fdebf638ba098 (diff)
Initial PostgreSQL schema and profile
Diffstat (limited to 'src/main/java/com/juick/service/PushQueriesServiceImpl.java')
-rw-r--r--src/main/java/com/juick/service/PushQueriesServiceImpl.java3
1 files changed, 2 insertions, 1 deletions
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;
}
}