方案有很多,示例1:建立唯一索引,在代码里获取到DuplicateKeyException异常后,重新查询。其他方式待补充 转载于:https://www.cnblogs.com/pigga/p/10098211.html