|
1 | 1 | package org.zstack.compute.vm;
|
2 | 2 |
|
3 | 3 | import com.google.common.collect.Maps;
|
4 |
| -import com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException; |
5 |
| -import org.apache.commons.collections.CollectionUtils; |
6 | 4 | import org.apache.commons.lang.StringUtils;
|
7 | 5 | import org.apache.commons.validator.routines.DomainValidator;
|
8 | 6 | import org.springframework.beans.factory.annotation.Autowired;
|
|
25 | 23 | import org.zstack.core.jsonlabel.JsonLabel;
|
26 | 24 | import org.zstack.core.thread.*;
|
27 | 25 | import org.zstack.core.workflow.FlowChainBuilder;
|
28 |
| -import org.zstack.directory.ResourceDirectoryRefVO; |
29 | 26 | import org.zstack.core.workflow.ShareFlow;
|
| 27 | +import org.zstack.directory.ResourceDirectoryRefVO; |
30 | 28 | import org.zstack.header.AbstractService;
|
31 | 29 | import org.zstack.header.allocator.AllocateHostDryRunReply;
|
32 | 30 | import org.zstack.header.allocator.DesignatedAllocateHostMsg;
|
|
82 | 80 | import org.zstack.tag.SystemTagCreator;
|
83 | 81 | import org.zstack.tag.SystemTagUtils;
|
84 | 82 | import org.zstack.tag.TagManager;
|
85 |
| -import org.zstack.utils.ExceptionDSL; |
86 |
| -import org.zstack.utils.ObjectUtils; |
87 |
| -import org.zstack.utils.TagUtils; |
88 |
| -import org.zstack.utils.Utils; |
| 83 | +import org.zstack.utils.*; |
89 | 84 | import org.zstack.utils.function.Function;
|
90 | 85 | import org.zstack.utils.logging.CLogger;
|
91 | 86 | import org.zstack.utils.network.IPv6NetworkUtils;
|
|
94 | 89 | import javax.persistence.PersistenceException;
|
95 | 90 | import javax.persistence.Tuple;
|
96 | 91 | import javax.persistence.TypedQuery;
|
| 92 | +import java.sql.SQLIntegrityConstraintViolationException; |
97 | 93 | import java.sql.Timestamp;
|
98 | 94 | import java.util.*;
|
99 | 95 | import java.util.concurrent.Future;
|
@@ -825,7 +821,7 @@ protected void scripts() {
|
825 | 821 | }.execute();
|
826 | 822 | break;
|
827 | 823 | } catch (PersistenceException e) {
|
828 |
| - if (ExceptionDSL.isCausedBy(e, MySQLIntegrityConstraintViolationException.class, "Duplicate entry")) { |
| 824 | + if (ExceptionDSL.isCausedBy(e, SQLIntegrityConstraintViolationException.class, "Duplicate entry")) { |
829 | 825 | logger.debug(String.format("Concurrent mac allocation. Mac[%s] has been allocated, try allocating another one. " +
|
830 | 826 | "The error[Duplicate entry] printed by jdbc.spi.SqlExceptionHelper is no harm, " +
|
831 | 827 | "we will try finding another mac", nicVO.getMac()));
|
|
0 commit comments