成都項目中因為MYSQL與SSDB備分時間不一致,導致主鍵產生器錯誤解決一例

來源:互聯網
上載者:User

標籤:

-- JFinal錯誤提示 Duplicate entry ‘1791361-1823391‘ for key ‘PRIMARY‘

-- 1、查看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)
-- 資料庫表的最大值
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


-- 設定SSDB的最大值:
set t_resource_base_pk 1823399
set t_resource_info_pk 1791369
set t_resource_my_info_pk 1615146
 
-- 驗證
get t_resource_base_pk
get t_resource_info_pk
get t_resource_my_info_pk

成都項目中因為MYSQL與SSDB備分時間不一致,導致主鍵產生器錯誤解決一例

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.