pymysql抛异常

1、pymysql.err.OperationalError: (4603, '[169b25d9bbb2d000-1][172.16.128.111:3306][anta_mw_stock_uat]ERR-CODE: [TDDL-4603][ERR_ACCROSS_DB_TRANSACTION] Transaction accross db is not supported in current transaction policy, transaction node is: XXXX_MW_STXXX_UAT_1564991814000KZVX_IDQD_0001, but this sql execute on: XXXX_MW_STXXX_UAT_1564991814000KZVX_IDQD_0000. ')

解决办法:设置autocommit=None

eg:pymysql.connect(host=stk_ipHost, user=stk_user, password=stk_pwd, database=stk_dataBase, port=stk_port,autocommit=None)

2、pymysql.err.IntegrityError: (1062, "[169c3f59e6b2d000-2][172.16.188.221:3306][anta_mw_stock_uat]ERR-CODE: [TDDL-4614][ERR_EXECUTE_ON_MYSQL] Error occurs when execute on GROUP 'ANTA_MW_STOCK_UAT_1564991814504KZVX_IDQD_0000' ATOM 'rm-bp11c0zb477lj5d1r_anta_mw_stock_uat_b3fu_0000': Duplicate entry '9223372036854775807' for key 'PRIMARY' ")

解决方法:提示的主键重复,但可能是主键长度问题。

posted @ 2023-08-18 15:00  Frank13054  阅读(96)  评论(0编辑  收藏  举报