aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service/PushQueriesServiceImpl.java
diff options
context:
space:
mode:
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;
}
}