In Chengdu Project, because of the inconsistency between MySQL and Ssdb, a case of primary key generator error is solved.

Source: Internet
Author: User
Tags generator

--jfinal error hint Duplicate entry ' 1791361-1823391 ' for key ' PRIMARY '

--1. View the primary key generator values for SSDB
Ssdb 127.0.0.1:8888> Scan t_resource_base t_resource_basezzzz 100
Key value
-------------------------
t_resource_base_pk:1823391
1 result (s) (0.001 sec)
--Maximum value of the database table
Select Max (resource_id_int) from T_resource_base; --1823399


-- =======================================================
Ssdb 127.0.0.1:8888> Scan T_resource_info t_resource_infozzzz 100
Key value
-------------------------
t_resource_info_pk:1791361

Select Max (id) from T_resource_info; --1791369


-- =======================================================
Ssdb 127.0.0.1:8888> Scan t_resource_my t_resource_myzzzz 100
Key value
-------------------------
t_resource_my_info_pk:1615134

Select Max (id) from T_resource_my_info; --1615146


--Set the maximum value of the SSDB:
Set T_RESOURCE_BASE_PK 1823399
Set T_RESOURCE_INFO_PK 1791369
Set T_RESOURCE_MY_INFO_PK 1615146

--Verification
Get T_RESOURCE_BASE_PK
Get T_RESOURCE_INFO_PK
Get T_RESOURCE_MY_INFO_PK

In Chengdu Project, because of the inconsistency between MySQL and Ssdb, a case of primary key generator error is solved.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.