{"id":105251,"date":"2026-09-15T07:16:26","date_gmt":"2026-09-14T23:16:26","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/105251.html"},"modified":"2026-09-15T07:16:26","modified_gmt":"2026-09-14T23:16:26","slug":"2pc-xa-%e5%bc%ba%e4%b8%80%e8%87%b4%e5%88%86%e5%b8%83%e5%bc%8f%e4%ba%8b%e5%8a%a1%e7%9a%84%e5%9f%ba%e7%a1%80%e6%a8%a1%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/105251.html","title":{"rendered":"2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b"},"content":{"rendered":"<\/p>\n<h4>2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b<\/h4>\n<ul>\n<li>\u5148\u4ece\u95ee\u9898\u5f00\u59cb&#xff1a;\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u63d0\u4ea4&#xff1f;<\/li>\n<li>2PC \u662f\u4ec0\u4e48&#xff1f;<\/li>\n<li>\u7b2c\u4e00\u9636\u6bb5&#xff1a;Prepare<\/li>\n<li>Prepare \u5230\u5e95\u610f\u5473\u7740\u4ec0\u4e48&#xff1f;<\/li>\n<li>\u7b2c\u4e8c\u9636\u6bb5&#xff1a;Commit<\/li>\n<li>\u5982\u679c\u6709\u4eba Prepare \u5931\u8d25\u5462&#xff1f;<\/li>\n<li>\u5b8c\u6574\u6d41\u7a0b<\/li>\n<li>\u4e3a\u4ec0\u4e48\u4e00\u5b9a\u9700\u8981\u4e24\u9636\u6bb5&#xff1f;<\/li>\n<li>2PC \u6700\u5927\u7684\u95ee\u9898&#xff1a;\u9501\u8d44\u6e90<\/li>\n<li>\u4e3e\u4e2a\u9ad8\u5e76\u53d1\u573a\u666f<\/li>\n<li>\u534f\u8c03\u8005\u6302\u4e86\u600e\u4e48\u529e&#xff1f;<\/li>\n<li>\u7b2c\u4e8c\u9636\u6bb5\u6d88\u606f\u4e22\u4e86\u4e5f\u4f1a\u9ebb\u70e6<\/li>\n<li>2PC \u7684\u6838\u5fc3\u7f3a\u70b9<\/li>\n<li>\u90a3 2PC \u6709\u6ca1\u6709\u4f18\u70b9&#xff1f;<\/li>\n<li>XA \u548c 2PC \u662f\u4ec0\u4e48\u5173\u7cfb&#xff1f;<\/li>\n<li>XA \u7684\u57fa\u672c\u601d\u60f3<\/li>\n<li>MySQL \u91cc\u7684 XA<\/li>\n<li>Seata XA \u53c8\u662f\u4ec0\u4e48&#xff1f;<\/li>\n<li>Seata XA \u7684\u7279\u70b9<\/li>\n<li>2PC \u548c\u672c\u5730\u4e8b\u52a1\u6709\u4ec0\u4e48\u672c\u8d28\u533a\u522b&#xff1f;<\/li>\n<li>\u4e3a\u4ec0\u4e48 2PC \u4e0d\u9002\u5408\u957f\u4e8b\u52a1&#xff1f;<\/li>\n<li>2PC \u548c TCC \u6709\u4ec0\u4e48\u76f4\u89c9\u533a\u522b&#xff1f;<\/li>\n<li>\u9762\u8bd5\u9898&#xff1a;<\/li>\n<li>\n<ul>\n<li>2PC \u4e3a\u4ec0\u4e48\u662f\u963b\u585e\u534f\u8bae&#xff1f;<\/li>\n<li>2PC \u80fd\u7edd\u5bf9\u4fdd\u8bc1\u4e00\u81f4\u6027\u5417&#xff1f;<\/li>\n<li>XA \u548c 2PC \u6709\u4ec0\u4e48\u533a\u522b&#xff1f;<\/li>\n<\/ul>\n<\/li>\n<li>\u628a\u6574\u4e2a\u77e5\u8bc6\u94fe\u4e32\u8d77\u6765<\/li>\n<li>\u672c\u7bc7\u535a\u6587\u5fc5\u987b\u8bb0\u4f4f\u7684 8 \u4e2a\u7ed3\u8bba<\/li>\n<\/ul>\n<p>\u4e0a\u4e00\u7bc7&#xff1a;\u300aACID\u3001CAP\u3001BASE&#xff0c;\u4ee5\u53ca\u5f3a\u4e00\u81f4\u6027\u548c\u6700\u7ec8\u4e00\u81f4\u6027\u300b \u4e0b\u4e00\u7bc7&#xff1a;\u300aTCC\u2014\u2014\u4e1a\u52a1\u5c42\u9762\u7684\u5206\u5e03\u5f0f\u4e8b\u52a1\u300b<\/p>\n<p>\u672c\u7bc7\u5f00\u59cb\u8fdb\u5165 2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b\u3002<\/p>\n<p>\u9700\u8981\u641e\u61c2\u7684\u4e0d\u662f\u201c\u80cc\u4e24\u9636\u6bb5\u6d41\u7a0b\u201d&#xff0c;\u800c\u662f&#xff1a;<\/p>\n<p>\u4e3a\u4ec0\u4e48\u9700\u8981\u4e24\u4e2a\u9636\u6bb5\u3001Prepare \u5230\u5e95\u5e72\u4e86\u4ec0\u4e48\u3001\u4e3a\u4ec0\u4e48\u4f1a\u9501\u8d44\u6e90\u3001\u534f\u8c03\u8005\u6302\u4e86\u4f1a\u600e\u6837&#xff0c;\u4ee5\u53ca XA \u548c 2PC \u7684\u5173\u7cfb\u3002<\/p>\n<h2>\u5148\u4ece\u95ee\u9898\u5f00\u59cb&#xff1a;\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u63d0\u4ea4&#xff1f;<\/h2>\n<p>\u5047\u8bbe\u4e00\u4e2a\u8f6c\u8d26\u4e1a\u52a1\u6d89\u53ca\u4e24\u4e2a\u6570\u636e\u5e93&#xff1a;<\/p>\n<p>DB1&#xff1a;A \u8d26\u6237 -100<br \/>\nDB2&#xff1a;B \u8d26\u6237 &#043;100<\/p>\n<p>\u6700\u76f4\u63a5\u7684\u505a\u6cd5&#xff1a;<\/p>\n<p>\u5148\u63d0\u4ea4 DB1<br \/>\n\u518d\u63d0\u4ea4 DB2<\/p>\n<p>\u95ee\u9898\u6765\u4e86&#xff1a;<\/p>\n<p>DB1 COMMIT \u6210\u529f \u2705<br \/>\nDB2 COMMIT \u5931\u8d25 \u274c<\/p>\n<p>\u7ed3\u679c&#xff1a;<\/p>\n<p>A -100<br \/>\nB \u6ca1 &#043;100<\/p>\n<p>\u4e1a\u52a1\u4e0d\u4e00\u81f4\u3002<\/p>\n<p>\u6240\u4ee5\u6211\u4eec\u5e0c\u671b&#xff1a;<\/p>\n<p>\u5728\u771f\u6b63\u63d0\u4ea4\u4e4b\u524d&#xff0c;\u5148\u786e\u8ba4\u6240\u6709\u53c2\u4e0e\u8005\u90fd\u201c\u51c6\u5907\u597d\u4e86\u201d\u3002<\/p>\n<p>\u8fd9\u5c31\u662f 2PC \u7684\u6838\u5fc3\u601d\u60f3\u3002<\/p>\n<hr \/>\n<h2>2PC \u662f\u4ec0\u4e48&#xff1f;<\/h2>\n<p>2PC&#xff0c;\u5168\u79f0&#xff1a;<\/p>\n<p>Two-Phase Commit<\/p>\n<p>\u4e2d\u6587&#xff1a;<\/p>\n<p>\u4e24\u9636\u6bb5\u63d0\u4ea4\u3002<\/p>\n<p>\u53c2\u4e0e\u89d2\u8272\u4e3b\u8981\u6709\u4e24\u4e2a&#xff1a;<\/p>\n<p>Coordinator<br \/>\n\u534f\u8c03\u8005<\/p>\n<p>Participant<br \/>\n\u53c2\u4e0e\u8005<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>                Coordinator<br \/>\n                     \u2502<br \/>\n          \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n          \u2193                     \u2193<br \/>\n      Participant A         Participant B<br \/>\n           DB1                  DB2<\/p>\n<p>\u534f\u8c03\u8005\u8d1f\u8d23&#xff1a;<\/p>\n<p>\u8be2\u95ee<br \/>\n\u51b3\u5b9a<br \/>\n\u901a\u77e5<\/p>\n<p>\u53c2\u4e0e\u8005\u8d1f\u8d23&#xff1a;<\/p>\n<p>\u6267\u884c\u672c\u5730\u4e8b\u52a1<br \/>\n\u51c6\u5907\u63d0\u4ea4<br \/>\n\u6700\u7ec8\u63d0\u4ea4 \/ \u56de\u6eda<\/p>\n<hr \/>\n<h2>\u7b2c\u4e00\u9636\u6bb5&#xff1a;Prepare<\/h2>\n<p>\u7b2c\u4e00\u9636\u6bb5\u4e0d\u662f\u6b63\u5f0f\u63d0\u4ea4\u3002<\/p>\n<p>\u800c\u662f&#xff1a;<\/p>\n<p>\u5148\u6267\u884c\u4e8b\u52a1&#xff0c;\u4f46\u6682\u65f6\u4e0d\u8981\u6700\u7ec8\u63d0\u4ea4\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>Coordinator<br \/>\n     \u2502<br \/>\n     \u251c\u2500\u2500 Prepare \u2192 DB1<br \/>\n     \u2514\u2500\u2500 Prepare \u2192 DB2<\/p>\n<p>DB1&#xff1a;<\/p>\n<p>A\u8d26\u6237 -100<\/p>\n<p>DB2&#xff1a;<\/p>\n<p>B\u8d26\u6237 &#043;100<\/p>\n<p>\u4f46\u6b64\u65f6&#xff1a;<\/p>\n<p>\u8fd8\u6ca1\u6709\u6700\u7ec8 COMMIT<\/p>\n<p>\u53c2\u4e0e\u8005\u4f1a\u544a\u8bc9\u534f\u8c03\u8005&#xff1a;<\/p>\n<p>DB1&#xff1a;\u6211\u51c6\u5907\u597d\u4e86<br \/>\nDB2&#xff1a;\u6211\u4e5f\u51c6\u5907\u597d\u4e86<\/p>\n<p>\u4e5f\u5c31\u662f&#xff1a;<\/p>\n<p>YES<br \/>\nYES<\/p>\n<hr \/>\n<h2>Prepare \u5230\u5e95\u610f\u5473\u7740\u4ec0\u4e48&#xff1f;<\/h2>\n<p>\u8fd9\u662f\u672c\u7bc7\u535a\u6587\u6700\u5173\u952e\u7684\u70b9\u3002<\/p>\n<p>Prepare \u4e0d\u662f\u7b80\u5355\u8bf4\u4e00\u53e5&#xff1a;<\/p>\n<p>\u201c\u6211\u53ef\u4ee5\u201d<\/p>\n<p>\u800c\u662f\u901a\u5e38\u610f\u5473\u7740&#xff1a;<\/p>\n<p>\u6211\u5df2\u7ecf\u628a\u4e8b\u52a1\u6267\u884c\u5230\u4e00\u4e2a\u201c\u53ea\u5dee\u6700\u540e\u63d0\u4ea4\u201d\u7684\u72b6\u6001\u3002<\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4&#xff1a;<\/p>\n<p>\u4e1a\u52a1 SQL \u5df2\u7ecf\u6267\u884c<br \/>\n\u65e5\u5fd7\u5df2\u7ecf\u6301\u4e45\u5316<br \/>\n\u9700\u8981\u7684\u9501\u8fd8\u6301\u6709\u7740<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p><span class=\"token keyword\">UPDATE<\/span> account<br \/>\n<span class=\"token keyword\">SET<\/span> balance <span class=\"token operator\">&#061;<\/span> balance <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">100<\/span><br \/>\n<span class=\"token keyword\">WHERE<\/span> id <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8fd9\u6761 SQL \u5df2\u7ecf\u6267\u884c\u3002<\/p>\n<p>\u4f46&#xff1a;<\/p>\n<p>\u4e8b\u52a1\u8fd8\u6ca1\u6709\u6700\u7ec8\u7ed3\u675f<\/p>\n<p>\u6240\u4ee5\u8d44\u6e90\u901a\u5e38\u4ecd\u7136\u88ab\u9501\u4f4f\u3002<\/p>\n<hr \/>\n<h2>\u7b2c\u4e8c\u9636\u6bb5&#xff1a;Commit<\/h2>\n<p>\u5982\u679c\u6240\u6709\u53c2\u4e0e\u8005\u90fd\u56de\u7b54&#xff1a;<\/p>\n<p>YES<\/p>\n<p>\u534f\u8c03\u8005\u51b3\u5b9a&#xff1a;<\/p>\n<p>\u5168\u5c40\u63d0\u4ea4<\/p>\n<p>\u7136\u540e&#xff1a;<\/p>\n<p>Coordinator<br \/>\n     \u2502<br \/>\n     \u251c\u2500\u2500 Commit \u2192 DB1<br \/>\n     \u2514\u2500\u2500 Commit \u2192 DB2<\/p>\n<p>\u6700\u7ec8&#xff1a;<\/p>\n<p>DB1 COMMIT<br \/>\nDB2 COMMIT<\/p>\n<p>\u4e8b\u52a1\u5b8c\u6210\u3002<\/p>\n<hr \/>\n<h2>\u5982\u679c\u6709\u4eba Prepare \u5931\u8d25\u5462&#xff1f;<\/h2>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>DB1&#xff1a;YES<br \/>\nDB2&#xff1a;NO<\/p>\n<p>\u53ef\u80fd DB2 \u56e0\u4e3a&#xff1a;<\/p>\n<p>\u4f59\u989d\u4e0d\u8db3<br \/>\nSQL \u6267\u884c\u5931\u8d25<br \/>\n\u6b7b\u9501<br \/>\n\u6570\u636e\u5e93\u5f02\u5e38<\/p>\n<p>\u65e0\u6cd5\u8fdb\u5165 Prepared \u72b6\u6001\u3002<\/p>\n<p>\u534f\u8c03\u8005\u5c31\u4f1a\u901a\u77e5&#xff1a;<\/p>\n<p>ROLLBACK<\/p>\n<p>\u4e8e\u662f&#xff1a;<\/p>\n<p>Coordinator<br \/>\n     \u2502<br \/>\n     \u251c\u2500\u2500 Rollback \u2192 DB1<br \/>\n     \u2514\u2500\u2500 Rollback \u2192 DB2<\/p>\n<p>\u6700\u7ec8&#xff1a;<\/p>\n<p>\u5927\u5bb6\u90fd\u4e0d\u63d0\u4ea4<\/p>\n<p>\u6240\u4ee5 2PC \u8ffd\u6c42\u7684\u662f&#xff1a;<\/p>\n<p>\u8981\u4e48\u4e00\u8d77 Commit<br \/>\n\u8981\u4e48\u4e00\u8d77 Rollback<\/p>\n<hr \/>\n<h2>\u5b8c\u6574\u6d41\u7a0b<\/h2>\n<p>\u6b63\u5e38\u63d0\u4ea4&#xff1a; <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260914231624-6aa880482c2fd.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>\u5931\u8d25&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260914231624-6aa88048aa499.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h2>\u4e3a\u4ec0\u4e48\u4e00\u5b9a\u9700\u8981\u4e24\u9636\u6bb5&#xff1f;<\/h2>\n<p>\u56e0\u4e3a\u534f\u8c03\u8005\u5fc5\u987b\u5148\u56de\u7b54\u4e00\u4e2a\u95ee\u9898&#xff1a;<\/p>\n<p>\u6240\u6709\u4eba\u90fd\u5177\u5907\u63d0\u4ea4\u6761\u4ef6\u4e86\u5417&#xff1f;<\/p>\n<p>\u5982\u679c\u4e0d\u505a Prepare&#xff1a;<\/p>\n<p>DB1 COMMIT<br \/>\n\u2193<br \/>\nDB2 COMMIT<\/p>\n<p>DB1 \u4e00\u65e6\u63d0\u4ea4&#xff0c;\u5c31\u4e0d\u80fd\u8f7b\u6613\u64a4\u9500\u3002<\/p>\n<p>\u800c Prepare \u7684\u4ef7\u503c\u5c31\u662f&#xff1a;<\/p>\n<p>\u5148\u4e0d\u8981\u771f\u6b63\u63d0\u4ea4<br \/>\n\u2193<br \/>\n\u6240\u6709\u4eba\u5148\u8fdb\u5165\u201c\u53ef\u63d0\u4ea4\u72b6\u6001\u201d<br \/>\n\u2193<br \/>\n\u518d\u7edf\u4e00\u51b3\u5b9a<\/p>\n<p>\u6240\u4ee5\u4f60\u53ef\u4ee5\u628a 2PC \u7406\u89e3\u6210&#xff1a;<\/p>\n<p>\u7b2c\u4e00\u9636\u6bb5&#xff1a;\u5927\u5bb6\u90fd\u51c6\u5907\u597d\u4e86\u5417&#xff1f;<\/p>\n<p>\u7b2c\u4e8c\u9636\u6bb5&#xff1a;\u65e2\u7136\u90fd\u51c6\u5907\u597d\u4e86&#xff0c;\u90a3\u4e00\u8d77\u63d0\u4ea4<\/p>\n<hr \/>\n<h2>2PC \u6700\u5927\u7684\u95ee\u9898&#xff1a;\u9501\u8d44\u6e90<\/h2>\n<p>\u73b0\u5728\u6765\u770b\u5b83\u4e3a\u4ec0\u4e48\u6027\u80fd\u4e0d\u597d\u3002<\/p>\n<p>\u5047\u8bbe DB1 \u6267\u884c&#xff1a;<\/p>\n<p><span class=\"token keyword\">UPDATE<\/span> account<br \/>\n<span class=\"token keyword\">SET<\/span> balance <span class=\"token operator\">&#061;<\/span> balance <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">100<\/span><br \/>\n<span class=\"token keyword\">WHERE<\/span> id <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5728 Prepare \u540e&#xff1a;<\/p>\n<p>\u4e8b\u52a1\u4e0d\u80fd\u7ed3\u675f<\/p>\n<p>\u56e0\u4e3a\u5b83\u8fd8\u5728\u7b49\u5f85\u534f\u8c03\u8005\u6700\u7ec8\u51b3\u5b9a\u3002<\/p>\n<p>\u4e8e\u662f\u53ef\u80fd\u4e00\u76f4\u6301\u6709&#xff1a;<\/p>\n<p>\u884c\u9501<br \/>\n\u8868\u9501<br \/>\n\u4e8b\u52a1\u8d44\u6e90<br \/>\n\u8fde\u63a5<\/p>\n<p>\u8fd9\u65f6\u5019\u53e6\u4e00\u4e2a\u8bf7\u6c42\u4e5f\u60f3\u4fee\u6539\u8fd9\u4e2a\u8d26\u6237&#xff1a;<\/p>\n<p>Transaction B<\/p>\n<p>\u5b83\u53ef\u80fd\u53ea\u80fd&#xff1a;<\/p>\n<p>\u7b49\u5f85\u2026\u2026<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>Prepare<br \/>\n   \u2193<br \/>\n\u7b49\u5f85\u534f\u8c03\u8005<br \/>\n   \u2193<br \/>\n\u8d44\u6e90\u6301\u7eed\u88ab\u5360\u7528<br \/>\n   \u2193<br \/>\n\u5e76\u53d1\u4e0b\u964d<\/p>\n<p>\u8fd9\u5c31\u662f 2PC \u5f88\u5927\u7684\u4ee3\u4ef7\u3002<\/p>\n<hr \/>\n<h2>\u4e3e\u4e2a\u9ad8\u5e76\u53d1\u573a\u666f<\/h2>\n<p>\u67d0\u70ed\u95e8\u5546\u54c1\u5e93\u5b58&#xff1a;<\/p>\n<p>stock &#061; 100<\/p>\n<p>\u5927\u91cf\u7528\u6237\u540c\u65f6\u62a2\u8d2d\u3002<\/p>\n<p>\u5982\u679c\u6bcf\u4e00\u4e2a\u8bf7\u6c42\u90fd\u8fdb\u5165\u5206\u5e03\u5f0f 2PC&#xff1a;<\/p>\n<p>\u9501\u5e93\u5b58<br \/>\n\u2193<br \/>\nPrepare<br \/>\n\u2193<br \/>\n\u7b49\u5f85\u5176\u4ed6\u670d\u52a1<br \/>\n\u2193<br \/>\n\u652f\u4ed8 Prepare<br \/>\n\u2193<br \/>\n\u8ba2\u5355 Prepare<br \/>\n\u2193<br \/>\n\u7edf\u4e00 Commit<\/p>\n<p>\u5e93\u5b58\u9501\u53ef\u80fd\u6301\u6709\u5f88\u957f\u65f6\u95f4\u3002<\/p>\n<p>\u7ed3\u679c&#xff1a;<\/p>\n<p>\u541e\u5410\u91cf\u4e0b\u964d<br \/>\n\u8bf7\u6c42\u7b49\u5f85<br \/>\n\u8d85\u65f6\u589e\u52a0<br \/>\n\u9501\u7ade\u4e89\u4e25\u91cd<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>2PC \u7684\u4e00\u81f4\u6027\u5f88\u5f3a&#xff0c;\u4f46\u534f\u8c03\u6210\u672c\u548c\u9501\u8d44\u6e90\u6210\u672c\u4e5f\u5f88\u9ad8\u3002<\/p>\n<hr \/>\n<h2>\u534f\u8c03\u8005\u6302\u4e86\u600e\u4e48\u529e&#xff1f;<\/h2>\n<p>\u8fd9\u662f\u7ecf\u5178\u95ee\u9898\u3002<\/p>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>DB1 \u5df2 Prepare<br \/>\nDB2 \u5df2 Prepare<\/p>\n<p>\u5b83\u4eec\u90fd\u5728\u7b49\u5f85&#xff1a;<\/p>\n<p>Commit&#xff1f;<br \/>\n\u8fd8\u662f Rollback&#xff1f;<\/p>\n<p>\u5c31\u5728\u8fd9\u65f6&#xff1a;<\/p>\n<p>Coordinator \u5d29\u4e86<\/p>\n<p>\u53c2\u4e0e\u8005\u4e0d\u77e5\u9053\u6700\u7ec8\u51b3\u5b9a\u3002<\/p>\n<p>\u4e8e\u662f&#xff1a;<\/p>\n<p>DB1&#xff1a;\u6211\u5230\u5e95\u63d0\u4ea4\u4e0d\u63d0\u4ea4&#xff1f;<br \/>\nDB2&#xff1a;\u6211\u4e5f\u4e0d\u77e5\u9053\u3002<\/p>\n<p>\u8fd9\u5c31\u662f 2PC \u4e2d\u7ecf\u5178\u7684&#xff1a;<\/p>\n<p>\u963b\u585e\u95ee\u9898\u3002<\/p>\n<p>\u53c2\u4e0e\u8005\u53ef\u80fd\u5fc5\u987b\u7ee7\u7eed\u4fdd\u6301 Prepared \u72b6\u6001\u3002<\/p>\n<p>\u4e5f\u610f\u5473\u7740&#xff1a;<\/p>\n<p>\u9501\u4e0d\u80fd\u91ca\u653e<br \/>\n\u8d44\u6e90\u4e0d\u80fd\u91ca\u653e<\/p>\n<p>\u4e00\u76f4\u7b49\u534f\u8c03\u8005\u6062\u590d\u3002<\/p>\n<hr \/>\n<h2>\u7b2c\u4e8c\u9636\u6bb5\u6d88\u606f\u4e22\u4e86\u4e5f\u4f1a\u9ebb\u70e6<\/h2>\n<p>\u5047\u8bbe&#xff1a;<\/p>\n<p>Coordinator \u51b3\u5b9a Commit<\/p>\n<p>\u53d1\u9001&#xff1a;<\/p>\n<p>Commit \u2192 DB1<br \/>\nCommit \u2192 DB2<\/p>\n<p>\u7ed3\u679c&#xff1a;<\/p>\n<p>DB1 \u6536\u5230 \u2705<br \/>\nDB2 \u6ca1\u6536\u5230 \u274c<\/p>\n<p>\u90a3\u4e48&#xff1a;<\/p>\n<p>DB1 \u5df2\u63d0\u4ea4<br \/>\nDB2 \u4ecd\u5728 Prepared<\/p>\n<p>DB2 \u4e0d\u77e5\u9053&#xff1a;<\/p>\n<p>\u5230\u5e95\u8be5\u63d0\u4ea4\u8fd8\u662f\u56de\u6eda<\/p>\n<p>\u6700\u7ec8\u5f80\u5f80\u9700\u8981&#xff1a;<\/p>\n<p>\u6062\u590d<br \/>\n\u91cd\u8bd5<br \/>\n\u72b6\u6001\u67e5\u8be2<br \/>\n\u65e5\u5fd7\u5224\u65ad<\/p>\n<p>\u6240\u4ee5\u5206\u5e03\u5f0f\u4e8b\u52a1\u4e0d\u662f\u4e00\u53e5&#xff1a;<\/p>\n<p>\u201c\u52a0\u4e2a\u534f\u8c03\u5668\u201d<\/p>\n<p>\u5c31\u89e3\u51b3\u4e86\u3002<\/p>\n<hr \/>\n<h2>2PC \u7684\u6838\u5fc3\u7f3a\u70b9<\/h2>\n<p>\u4f60\u53ef\u4ee5\u76f4\u63a5\u8bb0\u6210 4 \u4e2a&#xff1a;<\/p>\n<p>1. \u540c\u6b65\u963b\u585e<br \/>\n2. \u8d44\u6e90\u9501\u5b9a\u65f6\u95f4\u957f<br \/>\n3. \u534f\u8c03\u8005\u6545\u969c\u5f71\u54cd\u5927<br \/>\n4. \u7f51\u7edc\u5f02\u5e38\u4f1a\u4ea7\u751f\u4e0d\u786e\u5b9a\u72b6\u6001<\/p>\n<p>\u518d\u52a0\u4e00\u4e2a\u5de5\u7a0b\u5c42\u9762&#xff1a;<\/p>\n<p>5. \u6027\u80fd\u548c\u541e\u5410\u901a\u5e38\u8f83\u5dee<\/p>\n<hr \/>\n<h2>\u90a3 2PC \u6709\u6ca1\u6709\u4f18\u70b9&#xff1f;<\/h2>\n<p>\u5f53\u7136\u6709\u3002<\/p>\n<p>\u6700\u5927\u4f18\u70b9&#xff1a;<\/p>\n<p>\u4e00\u81f4\u6027\u5f3a<\/p>\n<p>\u7279\u522b\u9002\u5408&#xff1a;<\/p>\n<p>\u5bf9\u4e00\u81f4\u6027\u8981\u6c42\u975e\u5e38\u9ad8<br \/>\n\u53c2\u4e0e\u8d44\u6e90\u6bd4\u8f83\u6709\u9650<br \/>\n\u5e76\u53d1\u538b\u529b\u4e0d\u7b97\u7279\u522b\u9ad8<br \/>\n\u4e8b\u52a1\u65f6\u95f4\u8f83\u77ed<\/p>\n<p>\u7684\u573a\u666f\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>\u4f20\u7edf\u91d1\u878d\u6838\u5fc3\u4ea4\u6613<br \/>\n\u4f01\u4e1a\u5185\u90e8\u7cfb\u7edf<br \/>\n\u5f3a\u4e00\u81f4\u6570\u636e\u540c\u6b65<\/p>\n<p>\u4f46\u4e0d\u80fd\u7b80\u5355\u7406\u89e3\u6210&#xff1a;<\/p>\n<p>\u91d1\u878d &#061; \u4e00\u5b9a 2PC<\/p>\n<p>\u5b9e\u9645\u91d1\u878d\u7cfb\u7edf\u4e5f\u5927\u91cf\u4f7f\u7528&#xff1a;<\/p>\n<p>\u8d26\u52a1<br \/>\n\u6d88\u606f<br \/>\n\u8865\u507f<br \/>\n\u5bf9\u8d26<br \/>\n\u5e42\u7b49<\/p>\n<p>\u5171\u540c\u4fdd\u8bc1\u4e1a\u52a1\u4e00\u81f4\u6027\u3002<\/p>\n<hr \/>\n<h2>XA \u548c 2PC \u662f\u4ec0\u4e48\u5173\u7cfb&#xff1f;<\/h2>\n<p>\u8fd9\u662f\u9762\u8bd5\u9ad8\u9891\u95ee\u9898\u3002<\/p>\n<p>\u5148\u8bb0\u4e00\u53e5&#xff1a;<\/p>\n<p>2PC \u662f\u4e00\u79cd\u534f\u8bae\u601d\u60f3&#xff0c;XA \u662f\u4e00\u79cd\u6807\u51c6\u63a5\u53e3\u89c4\u8303\u3002<\/p>\n<p>2PC \u8bb2\u7684\u662f&#xff1a;<\/p>\n<p>Prepare<br \/>\nCommit \/ Rollback<\/p>\n<p>\u800c XA \u89e3\u51b3\u7684\u662f&#xff1a;<\/p>\n<p>\u4e0d\u540c\u4e8b\u52a1\u8d44\u6e90\u600e\u4e48\u6309\u7167\u7edf\u4e00\u63a5\u53e3\u53c2\u4e0e\u8fd9\u79cd\u5206\u5e03\u5f0f\u4e8b\u52a1&#xff1f;<\/p>\n<p>XA \u6700\u65e9\u7531 X\/Open \u63d0\u51fa\u3002<\/p>\n<p>\u4e00\u4e2a\u5178\u578b XA \u67b6\u6784&#xff1a;<\/p>\n<p>Application<br \/>\n     \u2502<br \/>\n     \u2193<br \/>\nTransaction Manager<br \/>\n     \u2502<br \/>\n     \u251c\u2500\u2500 XA Resource \u2192 MySQL<br \/>\n     \u2514\u2500\u2500 XA Resource \u2192 Oracle<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<p>TM&#xff1a;Transaction Manager<br \/>\n\u4e8b\u52a1\u7ba1\u7406\u5668<\/p>\n<p>RM&#xff1a;Resource Manager<br \/>\n\u8d44\u6e90\u7ba1\u7406\u5668<\/p>\n<p>\u6570\u636e\u5e93\u53ef\u4ee5\u4f5c\u4e3a RM\u3002<\/p>\n<hr \/>\n<h2>XA \u7684\u57fa\u672c\u601d\u60f3<\/h2>\n<p>\u4e8b\u52a1\u7ba1\u7406\u5668&#xff1a;<\/p>\n<p>TM<\/p>\n<p>\u8d1f\u8d23\u63a7\u5236\u5168\u5c40\u4e8b\u52a1\u3002<\/p>\n<p>\u591a\u4e2a\u6570\u636e\u5e93&#xff1a;<\/p>\n<p>RM1<br \/>\nRM2<br \/>\nRM3<\/p>\n<p>\u5206\u522b\u52a0\u5165\u540c\u4e00\u4e2a\u5168\u5c40\u4e8b\u52a1\u3002<\/p>\n<p>\u7136\u540e TM \u4f7f\u7528 XA \u63a5\u53e3&#xff1a;<\/p>\n<p>XA START<br \/>\nXA END<br \/>\nXA PREPARE<br \/>\nXA COMMIT<br \/>\nXA ROLLBACK<\/p>\n<p>\u63a7\u5236\u53c2\u4e0e\u8005\u3002<\/p>\n<p>\u56e0\u6b64&#xff1a;<\/p>\n<p>XA<br \/>\n\u2193<br \/>\n\u6807\u51c6\u5316\u63a5\u53e3<\/p>\n<p>2PC<br \/>\n\u2193<br \/>\n\u6838\u5fc3\u63d0\u4ea4\u534f\u8bae<\/p>\n<p>\u4f60\u53ef\u4ee5\u7406\u89e3\u4e3a&#xff1a;<\/p>\n<p>XA \u662f 2PC \u5728\u6570\u636e\u5e93\u4e8b\u52a1\u8d44\u6e90\u4e0a\u7684\u4e00\u79cd\u6807\u51c6\u5316\u5b9e\u73b0\u65b9\u5f0f\u3002<\/p>\n<hr \/>\n<h2>MySQL \u91cc\u7684 XA<\/h2>\n<p>MySQL \u652f\u6301 XA \u4e8b\u52a1\u3002<\/p>\n<p>\u6982\u5ff5\u4e0a\u53ef\u4ee5\u8fd9\u6837\u7406\u89e3&#xff1a;<\/p>\n<p>XA <span class=\"token keyword\">START<\/span> <span class=\"token string\">&#039;xid&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">UPDATE<\/span> account<br \/>\n<span class=\"token keyword\">SET<\/span> balance <span class=\"token operator\">&#061;<\/span> balance <span class=\"token operator\">&#8211;<\/span> <span class=\"token number\">100<\/span><br \/>\n<span class=\"token keyword\">WHERE<\/span> id <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>XA <span class=\"token keyword\">END<\/span> <span class=\"token string\">&#039;xid&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>XA <span class=\"token keyword\">PREPARE<\/span> <span class=\"token string\">&#039;xid&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8fd9\u65f6\u4e8b\u52a1\u8fdb\u5165&#xff1a;<\/p>\n<p>Prepared<\/p>\n<p>\u6700\u540e\u7531\u4e8b\u52a1\u7ba1\u7406\u5668\u51b3\u5b9a&#xff1a;<\/p>\n<p>XA <span class=\"token keyword\">COMMIT<\/span> <span class=\"token string\">&#039;xid&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u6216\u8005&#xff1a;<\/p>\n<p>XA <span class=\"token keyword\">ROLLBACK<\/span> <span class=\"token string\">&#039;xid&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5b9e\u9645\u5f00\u53d1\u4e2d\u4e00\u822c\u4e0d\u4f1a\u624b\u52a8\u8fd9\u6837\u5199&#xff0c;\u800c\u662f\u7531&#xff1a;<\/p>\n<p>\u4e8b\u52a1\u7ba1\u7406\u5668<br \/>\n\u6846\u67b6<br \/>\n\u4e2d\u95f4\u4ef6<\/p>\n<p>\u5e2e\u4f60\u5904\u7406\u3002<\/p>\n<hr \/>\n<h2>Seata XA \u53c8\u662f\u4ec0\u4e48&#xff1f;<\/h2>\n<p>Seata \u91cc\u4e5f\u6709 XA \u6a21\u5f0f\u3002<\/p>\n<p>\u53ef\u4ee5\u7c97\u7565\u7406\u89e3\u6210&#xff1a;<\/p>\n<p>\u5e94\u7528<br \/>\n  \u2502<br \/>\n  \u2193<br \/>\nSeata TC<br \/>\n  \u2502<br \/>\n  \u251c\u2500\u2500 MySQL XA<br \/>\n  \u251c\u2500\u2500 MySQL XA<br \/>\n  \u2514\u2500\u2500 MySQL XA<\/p>\n<p>\u5176\u4e2d&#xff1a;<\/p>\n<p>TC &#061; Transaction Coordinator<br \/>\nTM &#061; Transaction Manager<br \/>\nRM &#061; Resource Manager<\/p>\n<p>Seata TC \u8d1f\u8d23\u534f\u8c03\u5168\u5c40\u4e8b\u52a1\u3002<\/p>\n<p>\u5404\u6570\u636e\u5e93\u4f7f\u7528 XA \u80fd\u529b\u53c2\u4e0e\u3002<\/p>\n<hr \/>\n<h2>Seata XA \u7684\u7279\u70b9<\/h2>\n<p>\u4f18\u70b9&#xff1a;<\/p>\n<p>\u5f3a\u4e00\u81f4<br \/>\n\u5229\u7528\u6570\u636e\u5e93\u539f\u751f XA \u80fd\u529b<br \/>\n\u4e1a\u52a1\u4fb5\u5165\u76f8\u5bf9\u8f83\u4f4e<\/p>\n<p>\u7f3a\u70b9&#xff1a;<\/p>\n<p>Prepare \u9636\u6bb5\u4f1a\u9501\u8d44\u6e90<br \/>\n\u6027\u80fd\u53d7\u5f71\u54cd<br \/>\n\u4f9d\u8d56\u6570\u636e\u5e93 XA \u652f\u6301<br \/>\n\u957f\u4e8b\u52a1\u4e0d\u9002\u5408<\/p>\n<p>\u6240\u4ee5&#xff1a;<\/p>\n<p>Seata XA<\/p>\n<p>\u5e76\u6ca1\u6709\u4ece\u6839\u672c\u4e0a\u6d88\u9664 2PC \u7684\u7279\u70b9\u3002<\/p>\n<p>\u5b83\u53ea\u662f&#xff1a;<\/p>\n<p>\u5e2e\u4f60\u66f4\u65b9\u4fbf\u5730\u7ba1\u7406\u548c\u534f\u8c03 XA \u4e24\u9636\u6bb5\u4e8b\u52a1\u3002<\/p>\n<hr \/>\n<h2>2PC \u548c\u672c\u5730\u4e8b\u52a1\u6709\u4ec0\u4e48\u672c\u8d28\u533a\u522b&#xff1f;<\/h2>\n<p>\u672c\u5730\u4e8b\u52a1&#xff1a;<\/p>\n<p>\u4e00\u4e2a\u4e8b\u52a1\u7ba1\u7406\u5668<br \/>\n\u2193<br \/>\n\u4e00\u4e2a\u6570\u636e\u5e93\u8d44\u6e90<\/p>\n<p>2PC&#xff1a;<\/p>\n<p>\u4e00\u4e2a\u5168\u5c40\u534f\u8c03\u8005<br \/>\n\u2193<br \/>\n\u591a\u4e2a\u4e8b\u52a1\u8d44\u6e90<\/p>\n<p>\u672c\u5730\u4e8b\u52a1&#xff1a;<\/p>\n<p>BEGIN<br \/>\nSQL<br \/>\nCOMMIT<\/p>\n<p>2PC&#xff1a;<\/p>\n<p>\u591a\u4e2a\u6570\u636e\u5e93\u5206\u522b\u6267\u884c<br \/>\n\u2193<br \/>\n\u5168\u90e8 Prepare<br \/>\n\u2193<br \/>\n\u5168\u5c40\u7edf\u4e00 Commit \/ Rollback<\/p>\n<hr \/>\n<h2>\u4e3a\u4ec0\u4e48 2PC \u4e0d\u9002\u5408\u957f\u4e8b\u52a1&#xff1f;<\/h2>\n<p>\u5047\u8bbe\u4e1a\u52a1&#xff1a;<\/p>\n<p>\u7528\u6237\u4e0b\u5355<br \/>\n\u2193<br \/>\n\u9152\u5e97\u9884\u8ba2<br \/>\n\u2193<br \/>\n\u673a\u7968\u9884\u8ba2<br \/>\n\u2193<br \/>\n\u79df\u8f66<br \/>\n\u2193<br \/>\n\u4fdd\u9669<br \/>\n\u2193<br \/>\n\u652f\u4ed8<\/p>\n<p>\u6574\u4e2a\u6d41\u7a0b\u53ef\u80fd\u51e0\u5341\u79d2&#xff0c;\u751a\u81f3\u51e0\u5206\u949f\u3002<\/p>\n<p>\u5982\u679c\u90fd\u4f7f\u7528 2PC&#xff1a;<\/p>\n<p>\u9152\u5e97\u6570\u636e\u5e93\u9501\u7740<br \/>\n\u673a\u7968\u6570\u636e\u5e93\u9501\u7740<br \/>\n\u79df\u8f66\u6570\u636e\u5e93\u9501\u7740<br \/>\n\u652f\u4ed8\u6570\u636e\u5e93\u9501\u7740<\/p>\n<p>\u7b49\u5f85&#xff1a;<\/p>\n<p>\u6240\u6709\u4e1a\u52a1\u5b8c\u6210<\/p>\n<p>\u8fd9\u4e2a\u4ee3\u4ef7\u975e\u5e38\u9ad8\u3002<\/p>\n<p>\u6240\u4ee5\u957f\u4e8b\u52a1\u901a\u5e38\u66f4\u9002\u5408&#xff1a;<\/p>\n<p>Saga<\/p>\n<p>\u540e\u9762\u4f1a\u4e13\u95e8\u8bb2\u89e3 Saga\u3002<\/p>\n<hr \/>\n<h2>2PC \u548c TCC \u6709\u4ec0\u4e48\u76f4\u89c9\u533a\u522b&#xff1f;<\/h2>\n<p>\u73b0\u5728\u5148\u5efa\u7acb\u4e00\u4e2a\u76f4\u89c9\u3002<\/p>\n<p>2PC&#xff1a;<\/p>\n<p>\u6570\u636e\u5e93\u5c42\u9762<br \/>\nPrepare<br \/>\nCommit<br \/>\nRollback<\/p>\n<p>TCC&#xff1a;<\/p>\n<p>\u4e1a\u52a1\u5c42\u9762<br \/>\nTry<br \/>\nConfirm<br \/>\nCancel<\/p>\n<p>\u6bd4\u5982\u6263\u6b3e\u3002<\/p>\n<p>2PC&#xff1a;<\/p>\n<p>\u6570\u636e\u5e93 UPDATE<br \/>\n\u2193<br \/>\n\u4e8b\u52a1\u9501\u4f4f<br \/>\n\u2193<br \/>\n\u7b49\u5f85 Commit<\/p>\n<p>TCC&#xff1a;<\/p>\n<p>Try&#xff1a;<br \/>\n\u628a 100 \u5143\u53d8\u6210\u201c\u51bb\u7ed3\u72b6\u6001\u201d<\/p>\n<p>Confirm&#xff1a;<br \/>\n\u6b63\u5f0f\u6263\u9664<\/p>\n<p>Cancel&#xff1a;<br \/>\n\u91ca\u653e\u51bb\u7ed3<\/p>\n<p>TCC \u4e0d\u4e00\u5b9a\u957f\u65f6\u95f4\u6301\u6709\u6570\u636e\u5e93\u9501\u3002<\/p>\n<p>\u6240\u4ee5 TCC \u7528&#xff1a;<\/p>\n<p>\u4e1a\u52a1\u8d44\u6e90\u51bb\u7ed3<\/p>\n<p>\u6362\u53d6&#xff1a;<\/p>\n<p>\u6570\u636e\u5e93\u9501\u6301\u6709\u65f6\u95f4\u66f4\u77ed<\/p>\n<p>\u4ee3\u4ef7\u662f&#xff1a;<\/p>\n<p>\u4e1a\u52a1\u4ee3\u7801\u590d\u6742\u5f88\u591a<\/p>\n<p>\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u540e\u9762\u4f1a\u51fa\u73b0 TCC\u3002<\/p>\n<hr \/>\n<h2>\u9762\u8bd5\u9898&#xff1a;<\/h2>\n<h3>2PC \u4e3a\u4ec0\u4e48\u662f\u963b\u585e\u534f\u8bae&#xff1f;<\/h3>\n<p>\u7b54\u9898\u601d\u8def&#xff1a;<\/p>\n<p>\u5728\u7b2c\u4e00\u9636\u6bb5&#xff0c;\u53c2\u4e0e\u8005\u5b8c\u6210\u672c\u5730\u4e8b\u52a1\u5e76\u8fdb\u5165 Prepared \u72b6\u6001\u540e&#xff0c;\u9700\u8981\u7b49\u5f85\u534f\u8c03\u8005\u7684\u7b2c\u4e8c\u9636\u6bb5\u51b3\u7b56\u3002\u5728\u7b49\u5f85\u671f\u95f4\u901a\u5e38\u9700\u8981\u6301\u6709\u4e8b\u52a1\u8d44\u6e90\u548c\u9501&#xff0c;\u56e0\u6b64\u5982\u679c\u534f\u8c03\u8005\u8fdf\u8fdf\u6ca1\u6709\u53d1\u9001 Commit \u6216 Rollback&#xff0c;\u53c2\u4e0e\u8005\u5c31\u65e0\u6cd5\u72ec\u7acb\u7ed3\u675f\u4e8b\u52a1&#xff0c;\u4f1a\u4ea7\u751f\u963b\u585e\u3002<\/p>\n<p>\u8fd9\u53e5\u8bdd\u57fa\u672c\u5c31\u662f\u6807\u51c6\u56de\u7b54\u3002<\/p>\n<hr \/>\n<h3>2PC \u80fd\u7edd\u5bf9\u4fdd\u8bc1\u4e00\u81f4\u6027\u5417&#xff1f;<\/h3>\n<p>\u4e0d\u8981\u7b80\u5355\u56de\u7b54&#xff1a;<\/p>\n<p>\u80fd<\/p>\n<p>\u66f4\u597d\u7684\u56de\u7b54\u662f&#xff1a;<\/p>\n<p>2PC \u8bbe\u8ba1\u76ee\u6807\u662f\u4fdd\u8bc1\u539f\u5b50\u63d0\u4ea4&#xff0c;\u4f46\u5728\u771f\u5b9e\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u4ecd\u9700\u8981\u5904\u7406\u534f\u8c03\u8005\u6545\u969c\u3001\u6d88\u606f\u4e22\u5931\u3001\u7f51\u7edc\u5206\u533a\u3001\u8282\u70b9\u6062\u590d\u7b49\u5f02\u5e38&#xff0c;\u56e0\u6b64\u5de5\u7a0b\u4e0a\u4f9d\u8d56\u65e5\u5fd7\u3001\u6062\u590d\u673a\u5236\u3001\u91cd\u8bd5\u548c\u72b6\u6001\u67e5\u8be2\u6765\u7ef4\u6301\u4e8b\u52a1\u4e00\u81f4\u6027\u3002<\/p>\n<p>\u8fd9\u6837\u66f4\u51c6\u786e\u3002<\/p>\n<hr \/>\n<h3>XA \u548c 2PC \u6709\u4ec0\u4e48\u533a\u522b&#xff1f;<\/h3>\n<p>\u53ef\u4ee5\u8fd9\u6837\u56de\u7b54&#xff1a;<\/p>\n<p>2PC \u662f\u4e00\u79cd\u5206\u5e03\u5f0f\u539f\u5b50\u63d0\u4ea4\u534f\u8bae&#xff0c;\u5b9a\u4e49\u4e86 Prepare \u548c Commit\/Rollback \u4e24\u4e2a\u9636\u6bb5&#xff1b;XA \u662f X\/Open \u5b9a\u4e49\u7684\u5206\u5e03\u5f0f\u4e8b\u52a1\u63a5\u53e3\u89c4\u8303&#xff0c;\u7528\u4e8e\u8ba9\u4e8b\u52a1\u7ba1\u7406\u5668\u7edf\u4e00\u534f\u8c03\u4e0d\u540c\u8d44\u6e90\u7ba1\u7406\u5668\u3002XA \u901a\u5e38\u901a\u8fc7\u4e24\u9636\u6bb5\u63d0\u4ea4\u5b8c\u6210\u5168\u5c40\u4e8b\u52a1\u3002<\/p>\n<p>\u8fd9\u662f\u975e\u5e38\u5e38\u89c1\u7684\u4e00\u9053\u9898\u3002<\/p>\n<hr \/>\n<h2>\u628a\u6574\u4e2a\u77e5\u8bc6\u94fe\u4e32\u8d77\u6765<\/h2>\n<p>\u73b0\u5728\u6211\u4eec\u7684\u77e5\u8bc6\u5df2\u7ecf\u53d8\u6210&#xff1a;<\/p>\n<p>\u672c\u5730\u4e8b\u52a1<br \/>\n   \u2193<br \/>\nACID<br \/>\n   \u2193<br \/>\n\u8de8\u6570\u636e\u5e93<br \/>\n   \u2193<br \/>\n\u51fa\u73b0\u4e00\u81f4\u6027\u95ee\u9898<br \/>\n   \u2193<br \/>\n\u9700\u8981\u534f\u8c03<br \/>\n   \u2193<br \/>\n2PC<br \/>\n   \u2193<br \/>\nPhase 1&#xff1a;Prepare<br \/>\n   \u2193<br \/>\nPhase 2&#xff1a;Commit \/ Rollback<br \/>\n   \u2193<br \/>\n\u83b7\u5f97\u8f83\u5f3a\u4e00\u81f4\u6027<br \/>\n   \u2193<br \/>\n\u4ee3\u4ef7&#xff1a;<br \/>\n\u9501\u8d44\u6e90<br \/>\n\u963b\u585e<br \/>\n\u6027\u80fd\u4e0b\u964d<br \/>\n\u534f\u8c03\u8005\u6545\u969c<br \/>\n   \u2193<br \/>\n\u4e8e\u662f\u7ee7\u7eed\u51fa\u73b0<br \/>\nTCC \/ Saga \/ MQ \u6700\u7ec8\u4e00\u81f4\u6027<\/p>\n<p>\u4f60\u4f1a\u53d1\u73b0&#xff1a;<\/p>\n<p>\u540e\u9762\u7684\u5206\u5e03\u5f0f\u4e8b\u52a1\u65b9\u6848&#xff0c;\u672c\u8d28\u4e0a\u5f88\u591a\u90fd\u662f\u5728\u89e3\u51b3 2PC \u592a\u201c\u91cd\u201d\u7684\u95ee\u9898\u3002<\/p>\n<hr \/>\n<h2>\u672c\u7bc7\u535a\u6587\u5fc5\u987b\u8bb0\u4f4f\u7684 8 \u4e2a\u7ed3\u8bba<\/h2>\n<li>2PC &#061; \u4e24\u9636\u6bb5\u63d0\u4ea4\u3002<\/li>\n<li>\u7b2c\u4e00\u9636\u6bb5\u662f Prepare&#xff0c;\u4e0d\u662f\u6700\u7ec8\u63d0\u4ea4\u3002<\/li>\n<li>Prepare \u540e&#xff0c;\u53c2\u4e0e\u8005\u901a\u5e38\u5df2\u7ecf\u6267\u884c\u4e86\u4e1a\u52a1 SQL&#xff0c;\u5e76\u6301\u6709\u4e8b\u52a1\u8d44\u6e90\u3002<\/li>\n<li>\u6240\u6709\u53c2\u4e0e\u8005 Prepare \u6210\u529f\u540e&#xff0c;\u534f\u8c03\u8005\u624d\u7edf\u4e00 Commit\u3002<\/li>\n<li>\u4efb\u4e00\u53c2\u4e0e\u8005 Prepare \u5931\u8d25&#xff0c;\u5219\u6574\u4f53 Rollback\u3002<\/li>\n<li>2PC \u7684\u6838\u5fc3\u95ee\u9898\u662f\u963b\u585e\u3001\u9501\u65f6\u95f4\u957f\u3001\u534f\u8c03\u6210\u672c\u9ad8\u3002<\/li>\n<li>XA \u662f\u63a5\u53e3\u89c4\u8303&#xff0c;2PC \u662f\u63d0\u4ea4\u534f\u8bae\u3002<\/li>\n<li>Seata XA \u672c\u8d28\u4e0a\u4ecd\u7136\u5c5e\u4e8e\u57fa\u4e8e\u6570\u636e\u5e93 XA \u80fd\u529b\u7684\u5f3a\u4e00\u81f4\u4e8b\u52a1\u65b9\u6848\u3002<\/li>\n<p>\u4e0b\u4e00\u7bc7\u535a\u6587\u5c06\u76f4\u63a5\u8fdb\u5165 TCC\u3002<\/p>\n<p>\u56e0\u4e3a\u4f60\u73b0\u5728\u5df2\u7ecf\u77e5\u9053 2PC \u6700\u5927\u7684\u95ee\u9898&#xff1a;<\/p>\n<p>Prepare \u540e\u8d44\u6e90\u4e00\u76f4\u9501\u7740<\/p>\n<p>\u90a3\u4e48 TCC \u8981\u89e3\u51b3\u7684\u95ee\u9898\u5c31\u662f&#xff1a;<\/p>\n<p>\u80fd\u4e0d\u80fd\u4e0d\u7528\u957f\u65f6\u95f4\u9501\u6570\u636e\u5e93\u8d44\u6e90&#xff0c;\u800c\u662f\u7531\u4e1a\u52a1\u81ea\u5df1\u5148\u201c\u9884\u7559\u8d44\u6e90\u201d&#xff1f;<\/p>\n<p>\u4e0b\u4e00\u7bc7\u6211\u4f1a\u91cd\u70b9\u8bb2&#xff1a;<\/p>\n<p>Try \u5230\u5e95\u505a\u4ec0\u4e48<br \/>\nConfirm \u600e\u4e48\u8bbe\u8ba1<br \/>\nCancel \u600e\u4e48\u8bbe\u8ba1<br \/>\n\u4e3a\u4ec0\u4e48\u5fc5\u987b\u5e42\u7b49<br \/>\n\u4ec0\u4e48\u662f\u7a7a\u56de\u6eda<br \/>\n\u4ec0\u4e48\u662f\u60ac\u6302<br \/>\nTCC \u600e\u4e48\u8bbe\u8ba1\u8d26\u6237\u6263\u6b3e<br \/>\nTCC \u4e3a\u4ec0\u4e48\u6bd4 2PC \u6027\u80fd\u66f4\u9ad8<br \/>\nTCC \u53c8\u4e3a\u4ec0\u4e48\u5f00\u53d1\u6210\u672c\u66f4\u9ad8<\/p>\n<p>\u4e0a\u4e00\u7bc7&#xff1a;\u300aACID\u3001CAP\u3001BASE&#xff0c;\u4ee5\u53ca\u5f3a\u4e00\u81f4\u6027\u548c\u6700\u7ec8\u4e00\u81f4\u6027\u300b \u4e0b\u4e00\u7bc7&#xff1a;\u300aTCC\u2014\u2014\u4e1a\u52a1\u5c42\u9762\u7684\u5206\u5e03\u5f0f\u4e8b\u52a1\u300b<\/p>\n<hr \/>\n<p>\u82e5\u6709\u8f6c\u8f7d&#xff0c;\u8bf7\u6807\u660e\u51fa\u5904&#xff1a;https:\/\/blog.csdn.net\/CharlesYuangc\/article\/details\/165342002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b\u5148\u4ece\u95ee\u9898\u5f00\u59cb&#xff1a;\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u63d0\u4ea4&#xff1f;2PC \u662f\u4ec0\u4e48&#xff1f;\u7b2c\u4e00\u9636\u6bb5&#xff1a;PreparePrepare \u5230\u5e95\u610f\u5473\u7740\u4ec0\u4e48&#xff1f;\u7b2c\u4e8c\u9636\u6bb5&#xff1a;Commit\u5982\u679c\u6709\u4eba Prepare \u5931\u8d25\u5462&#xff1f;\u5b8c\u6574\u6d41\u7a0b\u4e3a\u4ec0\u4e48\u4e00\u5b9a\u9700\u8981\u4e24\u9636\u6bb5&#xff1f;2PC \u6700\u5927\u7684\u95ee\u9898&#xff1a;\u9501\u8d44\u6e90\u4e3e\u4e2a\u9ad8\u5e76\u53d1\u573a\u666f\u534f\u8c03\u8005\u6302\u4e86\u600e\u4e48\u529e&#xff1f;\u7b2c\u4e8c\u9636\u6bb5\u6d88\u606f\u4e22\u4e86\u4e5f\u4f1a\u9ebb\u70e62PC \u7684\u6838\u5fc3\u7f3a\u70b9\u90a3<\/p>\n","protected":false},"author":2,"featured_media":105249,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[11950,11951,11952,664,3536],"topic":[],"class_list":["post-105251","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-2pc","tag-ca","tag-cap","tag-664","tag-3536"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/105251.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b\u5148\u4ece\u95ee\u9898\u5f00\u59cb&#xff1a;\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u63d0\u4ea4&#xff1f;2PC \u662f\u4ec0\u4e48&#xff1f;\u7b2c\u4e00\u9636\u6bb5&#xff1a;PreparePrepare \u5230\u5e95\u610f\u5473\u7740\u4ec0\u4e48&#xff1f;\u7b2c\u4e8c\u9636\u6bb5&#xff1a;Commit\u5982\u679c\u6709\u4eba Prepare \u5931\u8d25\u5462&#xff1f;\u5b8c\u6574\u6d41\u7a0b\u4e3a\u4ec0\u4e48\u4e00\u5b9a\u9700\u8981\u4e24\u9636\u6bb5&#xff1f;2PC \u6700\u5927\u7684\u95ee\u9898&#xff1a;\u9501\u8d44\u6e90\u4e3e\u4e2a\u9ad8\u5e76\u53d1\u573a\u666f\u534f\u8c03\u8005\u6302\u4e86\u600e\u4e48\u529e&#xff1f;\u7b2c\u4e8c\u9636\u6bb5\u6d88\u606f\u4e22\u4e86\u4e5f\u4f1a\u9ebb\u70e62PC \u7684\u6838\u5fc3\u7f3a\u70b9\u90a3\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/105251.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-14T23:16:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260914231624-6aa880482c2fd.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/105251.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/105251.html\",\"name\":\"2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-14T23:16:26+00:00\",\"dateModified\":\"2026-09-14T23:16:26+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/105251.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/105251.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/105251.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/105251.html","og_locale":"zh_CN","og_type":"article","og_title":"2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b\u5148\u4ece\u95ee\u9898\u5f00\u59cb&#xff1a;\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u63d0\u4ea4&#xff1f;2PC \u662f\u4ec0\u4e48&#xff1f;\u7b2c\u4e00\u9636\u6bb5&#xff1a;PreparePrepare \u5230\u5e95\u610f\u5473\u7740\u4ec0\u4e48&#xff1f;\u7b2c\u4e8c\u9636\u6bb5&#xff1a;Commit\u5982\u679c\u6709\u4eba Prepare \u5931\u8d25\u5462&#xff1f;\u5b8c\u6574\u6d41\u7a0b\u4e3a\u4ec0\u4e48\u4e00\u5b9a\u9700\u8981\u4e24\u9636\u6bb5&#xff1f;2PC \u6700\u5927\u7684\u95ee\u9898&#xff1a;\u9501\u8d44\u6e90\u4e3e\u4e2a\u9ad8\u5e76\u53d1\u573a\u666f\u534f\u8c03\u8005\u6302\u4e86\u600e\u4e48\u529e&#xff1f;\u7b2c\u4e8c\u9636\u6bb5\u6d88\u606f\u4e22\u4e86\u4e5f\u4f1a\u9ebb\u70e62PC \u7684\u6838\u5fc3\u7f3a\u70b9\u90a3","og_url":"https:\/\/www.wsisp.com\/helps\/105251.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-14T23:16:26+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260914231624-6aa880482c2fd.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/105251.html","url":"https:\/\/www.wsisp.com\/helps\/105251.html","name":"2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-14T23:16:26+00:00","dateModified":"2026-09-14T23:16:26+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/105251.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/105251.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/105251.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"2PC \/ XA\u2014\u2014\u5f3a\u4e00\u81f4\u5206\u5e03\u5f0f\u4e8b\u52a1\u7684\u57fa\u7840\u6a21\u578b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/105251","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=105251"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/105251\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/105249"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=105251"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=105251"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=105251"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=105251"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}