{"id":57531,"date":"2025-08-15T14:30:57","date_gmt":"2025-08-15T06:30:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/57531.html"},"modified":"2025-08-15T14:30:57","modified_gmt":"2025-08-15T06:30:57","slug":"springboot%e5%ad%a6%e4%b9%a0%e6%97%a5%e8%ae%b0%ef%bc%88%e5%85%ab%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/57531.html","title":{"rendered":"SpringBoot\u5b66\u4e60\u65e5\u8bb0\uff08\u516b\uff09"},"content":{"rendered":"<p>\u4eca\u5929\u6211\u4eec\u6765\u8bf4\u4e00\u4e0bSpring\u548cSpringBoot\u7684\u533a\u522b&#xff0c;\u5f88\u591a\u5c0f\u4f19\u4f34\u5176\u5b9e\u90fd\u5206\u4e0d\u6e05\u695a\u7684&#xff0c;\u8fd9\u4e2a\u867d\u7136\u5bf9\u6280\u672f\u4e0a\u6ca1\u4ec0\u4e48\u63d0\u5347&#xff0c;\u4f46\u662f\u4e07\u4e00\u9762\u8bd5\u95ee\u5230\u603b\u8fd8\u662f\u6709\u70b9\u7528\u7684\u3002<\/p>\n<h2>Spring\u548cSpringBoot\u7684\u533a\u522b<\/h2>\n<p>\u4ece\u5386\u53f2\u6765\u770b\u7684\u8bdd\u80af\u5b9a\u662f\u5148\u6709Spring\u518d\u6709SpringBoot\u7684&#xff0c;\u4ed6\u4eec\u7684\u5730\u4f4d\u662f\u4e0d\u540c\u7684&#xff0c;Spring\u5176\u5b9e\u5e94\u8be5\u53ebSpringFramework&#xff0c;\u4e5f\u5c31\u662f\u6846\u67b6\u7684\u610f\u601d\u3002\u800cSpringBoot\u4e3b\u5305\u89c9\u5f97\u66f4\u50cf\u662f\u4e00\u952e\u542f\u52a8\u7684\u610f\u601d\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"500\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815062959-689ed3e7d01da.png\" width=\"505\" \/><\/p>\n<p>\u8fd9\u4e2a\u662fSpring\u4e2d\u6587\u7f51\u5bf9SpringSpring Framework \u4e2d\u6587\u6587\u6863\u7684\u4ecb\u7ecd&#xff0c;\u53ef\u4ee5\u770b\u5230\u6211\u4eec\u524d\u51e0\u7bc7\u8bf4\u7684\u5185\u5bb9\u57fa\u672c\u4e0a\u90fd\u662fSpring\u7684\u548cSpringBoot\u57fa\u672c\u4e0a\u6ca1\u4ec0\u4e48\u5173\u7cfb&#xff0c;\u800c\u4e0b\u9762\u662fSpringBoot\u7684\u4ecb\u7ecd\u9875\u9762&#xff0c;\u597d\u50cf\u4e5f\u6709Spring\u7684\u5185\u5bb9\u4f46\u597d\u50cf\u5927\u90e8\u5206\u90fd\u662f\u7ec4\u4ef6&#xff0c;\u8fd9\u91cc\u5c31\u662fSpring\u548cSpringBoot\u7684\u533a\u522b\u6240\u5728\u3002<\/p>\n<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"500\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815063023-689ed3ffd725e.png\" width=\"624\" \/><\/p>\n<table>\n<tr>\u7279\u6027\u200b\u200bSpring\u200b\u200bSpring Boot\u200b<\/tr>\n<tbody>\n<tr>\n<td>\u200b\u914d\u7f6e\u65b9\u5f0f\u200b<\/td>\n<td>\u9700\u624b\u52a8\u914d\u7f6e XML \u6216 JavaConfig<\/td>\n<td>\u81ea\u52a8\u914d\u7f6e&#xff08;&#064;EnableAutoConfiguration&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u200b\u4f9d\u8d56\u7ba1\u7406\u200b<\/td>\n<td>\u9700\u624b\u52a8\u7ba1\u7406\u4f9d\u8d56\u7248\u672c<\/td>\n<td>\u901a\u8fc7\u00a0starter\u00a0\u81ea\u52a8\u7ba1\u7406\u4f9d\u8d56&#xff08;\u5982\u00a0spring-boot-starter-web&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u200b\u5185\u5d4c\u670d\u52a1\u5668\u200b<\/td>\n<td>\u9700\u624b\u52a8\u90e8\u7f72\u5230 Tomcat\/Jetty<\/td>\n<td>\u9ed8\u8ba4\u5185\u5d4c Tomcat\/Jetty&#xff08;\u65e0\u9700\u989d\u5916\u90e8\u7f72&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u200b\u9879\u76ee\u542f\u52a8\u200b<\/td>\n<td>\u9700\u914d\u7f6e\u00a0web.xml\u00a0\u548c\u00a0DispatcherServlet<\/td>\n<td>\u53ea\u9700\u00a0main()\u00a0\u65b9\u6cd5 &#043;\u00a0&#064;SpringBootApplication<\/td>\n<\/tr>\n<tr>\n<td>\u200b\u76d1\u63a7\u4e0e\u7ba1\u7406\u200b<\/td>\n<td>\u9700\u96c6\u6210 Spring Actuator<\/td>\n<td>\u5185\u7f6e Actuator&#xff08;\u63d0\u4f9b\u5065\u5eb7\u68c0\u67e5\u3001\u6307\u6807\u76d1\u63a7\u7b49&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u200b\u6253\u5305\u90e8\u7f72\u200b<\/td>\n<td>\u9700\u6253\u5305\u4e3a WAR \u5e76\u90e8\u7f72\u5230\u5916\u90e8\u670d\u52a1\u5668<\/td>\n<td>\u53ef\u6253\u5305\u4e3a\u72ec\u7acb JAR&#xff08;\u5305\u542b\u6240\u6709\u4f9d\u8d56&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u200b\u9002\u7528\u573a\u666f\u200b<\/td>\n<td>\u9700\u8981\u9ad8\u5ea6\u5b9a\u5236\u5316\u7684\u590d\u6742\u4f01\u4e1a\u5e94\u7528<\/td>\n<td>\u5feb\u901f\u5f00\u53d1\u5fae\u670d\u52a1\u3001REST API \u6216\u5355\u4f53\u5e94\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4ece\u8fd9\u4e2a\u8868\u683c\u53ef\u4ee5\u77e5\u9053SpringBoot\u5176\u5b9e\u662fSpring\u7684\u589e\u5f3a\u7248\u672c&#xff0c;\u6ca1\u6709Spring\u4f5c\u4e3a\u57fa\u7840\u5c31\u6ca1\u6709\u73b0\u5728\u7684SpringBoot&#xff0c;SpringBoot\u5176\u5b9e\u5c31\u662f\u6574\u5408\u7ec4\u4ef6\u7684\u7f1d\u5408\u602a&#xff0c;\u628aSpring\u548c\u5404\u5927\u4f18\u79c0\u7684\u4e2d\u95f4\u4ef6\u805a\u62e2\u518d\u4e00\u8d77\u5f62\u6210\u4e00\u4e2a\u9879\u76ee&#xff0c;\u6211\u4eec\u5e38\u8bf4\u7684\u81ea\u52a8\u88c5\u914d\u3001\u81ea\u52a8\u914d\u7f6e\u5c31\u662fSpringBoot\u7684\u6838\u5fc3\u529f\u80fd\u3002<\/p>\n<p>SpringBoot\u76f8\u5bf9\u4e8eSpring\u4f1a\u52a0\u8f7dyml\u6587\u4ef6\u4ee5\u53ca\u626b\u63cf&#064;Configuration\u6ce8\u89e3\u81ea\u52a8\u7684\u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\u4e3a\u6211\u4eec\u914d\u7f6e\u597d\u7c7b&#xff0c;\u4e0d\u9700\u8981\u518d\u53bbxml\u4e2d\u5b9a\u4e49\u4e86&#xff0c;\u8fd8\u6709\u5c31\u662fSpring\u7684\u9879\u76ee\u662f\u9700\u8981\u7f16\u5199web.xml\u7684\u4e5f\u5c31\u662f\u9700\u8981\u642d\u914d\u4f7f\u7528Tomcat\u670d\u52a1\u5668&#xff0c;\u800c\u6211\u4eecSpringBoot\u5185\u7f6e\u4e86Tomcat\u670d\u52a1\u5668&#xff0c;\u53ea\u9700\u8981\u4e00\u4e2a&#064;SpringBootApplication\u6ce8\u89e3\u5c31\u53ef\u4ee5\u76f4\u63a5\u542f\u52a8\u6211\u4eec\u7684\u9879\u76ee\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48SpringBoot\u8fd9\u4e48\u706b\u7206\u7684\u539f\u56e0&#xff0c;\u6211\u4eec\u53ea\u9700\u8981\u628a\u81ea\u5df1\u8981\u4f7f\u7528\u7684\u7ec4\u4ef6\u52a0\u5165\u8fdb\u6765\u5c31\u53ef\u4ee5\u5feb\u901f\u7684\u5b8c\u6210\u4e00\u4e2a\u5c0f\u578b\u9879\u76ee&#xff0c;\u5927\u5927\u7684\u964d\u4f4e\u4e86\u5f00\u53d1\u7684\u95e8\u69db&#xff0c;\u51cf\u5c11\u4e86\u5927\u91cf\u7684\u914d\u7f6e\u6587\u4ef6\u7f16\u5199&#xff0c;\u8ba9\u5404\u4e2a\u7ec4\u4ef6\u53ef\u4ee5\u66f4\u52a0\u5bb9\u6613\u7684\u642d\u914d\u4f7f\u7528\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48SpringBoot\u7531\u79f0\u4e3a\u811a\u624b\u67b6\u7684\u539f\u56e0\u3002<\/p>\n<h2>\u58f0\u660e\u5f0f\u4e8b\u52a1<\/h2>\n<p>\u8fd9\u4e00\u671f\u7684\u5185\u5bb9\u4e0d\u591f\u4e86&#xff0c;\u62ff\u8fd9\u4e2a\u6765\u6c34\u4e00\u4e0b\u5427\u3002\u4e8b\u52a1\u662f\u6570\u636e\u5e93\u64cd\u4f5c\u7684\u6700\u5c0f\u903b\u8f91\u5355\u5143&#xff0c;\u5b83\u4f5c\u4e3a\u4e00\u4e2a\u4e0d\u53ef\u5206\u5272\u7684\u5de5\u4f5c\u5e8f\u5217&#xff0c;\u8981\u4e48\u5168\u90e8\u6267\u884c\u6210\u529f&#xff0c;\u8981\u4e48\u5168\u90e8\u56de\u6eda\u200b&#xff08;\u5c31\u50cf\u4ece\u672a\u6267\u884c\u8fc7&#xff09;\u3002\u786e\u4fdd\u6570\u636e\u4ece\u4e00\u79cd\u4e00\u81f4\u72b6\u6001\u8f6c\u53d8\u4e3a\u53e6\u4e00\u79cd\u4e00\u81f4\u72b6\u6001\u3002\u4ee3\u7801\u8fd9\u4e2a\u662f\u4e8b\u52a1\u7684\u56db\u5927\u7279\u6027\u4e5f\u53eb&#xff08;ACID&#xff09;\u3002<\/p>\n<table>\n<tr>\u7279\u6027\u200b\u200b\u8bf4\u660e\u200b\u200b\u793a\u4f8b\u200b<\/tr>\n<tbody>\n<tr>\n<td>\u200b\u539f\u5b50\u6027\u200b (Atomicity)<\/td>\n<td>\u4e8b\u52a1\u4e2d\u7684\u64cd\u4f5c\u8981\u4e48\u5168\u90e8\u6210\u529f&#xff0c;\u8981\u4e48\u5168\u90e8\u5931\u8d25&#xff08;\u6ca1\u6709\u4e2d\u95f4\u72b6\u6001&#xff09;\u3002<\/td>\n<td>\u8f6c\u8d26\u64cd\u4f5c&#xff1a;A \u6263\u6b3e\u548c B \u5165\u6b3e\u5fc5\u987b\u540c\u65f6\u6210\u529f\u6216\u5931\u8d25\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u200b\u4e00\u81f4\u6027\u200b (Consistency)<\/td>\n<td>\u4e8b\u52a1\u6267\u884c\u524d\u540e&#xff0c;\u6570\u636e\u5e93\u7684\u5b8c\u6574\u6027\u7ea6\u675f\u4e0d\u88ab\u7834\u574f&#xff08;\u5982\u5916\u952e\u3001\u552f\u4e00\u6027\u7ea6\u675f&#xff09;\u3002<\/td>\n<td>\u8f6c\u8d26\u540e&#xff0c;A &#043; B \u7684\u603b\u91d1\u989d\u4e0d\u53d8\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u200b\u9694\u79bb\u6027\u200b (Isolation)<\/td>\n<td>\u5e76\u53d1\u4e8b\u52a1\u4e4b\u95f4\u4e92\u4e0d\u5e72\u6270&#xff0c;\u9632\u6b62\u6570\u636e\u6df7\u4e71&#xff08;\u901a\u8fc7\u9501\u6216 MVCC \u5b9e\u73b0&#xff09;\u3002<\/td>\n<td>\u4e8b\u52a1 A \u8bfb\u53d6\u65f6&#xff0c;\u4e8b\u52a1 B \u4e0d\u80fd\u4fee\u6539\u672a\u63d0\u4ea4\u7684\u6570\u636e\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u200b\u6301\u4e45\u6027\u200b (Durability)<\/td>\n<td>\u4e8b\u52a1\u4e00\u65e6\u63d0\u4ea4&#xff0c;\u7ed3\u679c\u6c38\u4e45\u4fdd\u5b58&#xff08;\u5373\u4f7f\u7cfb\u7edf\u5d29\u6e83&#xff09;\u3002<\/td>\n<td>\u8f6c\u8d26\u6210\u529f\u540e&#xff0c;\u6570\u636e\u5fc5\u987b\u5199\u5165\u78c1\u76d8\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#064;Autowired<br \/>\nprivate PlatformTransactionManager transactionManager;<\/p>\n<p>public void transferMoney() {<br \/>\n    TransactionStatus status &#061; transactionManager.getTransaction(new DefaultTransactionDefinition());<br \/>\n    try {<br \/>\n        \/\/ \u4e1a\u52a1\u4ee3\u7801&#xff08;\u5982\u6263\u6b3e\u3001\u5165\u6b3e&#xff09;<br \/>\n        accountDao.debit(fromAccount, amount);<br \/>\n        accountDao.credit(toAccount, amount);<br \/>\n        transactionManager.commit(status); \/\/ \u63d0\u4ea4<br \/>\n    } catch (Exception e) {<br \/>\n        transactionManager.rollback(status); \/\/ \u56de\u6eda<br \/>\n        throw e;<br \/>\n    }<br \/>\n} <\/p>\n<p>\u8fd9\u4e2a\u662f\u6211\u4eec\u7684\u624b\u52a8\u4e8b\u52a1&#xff0c;\u4e00\u822c\u60c5\u51b5\u4e0b\u8fd8\u4f1a\u642d\u914d\u5206\u5e03\u5f0f\u9501\u6216\u8005Redis\u9501\u6765\u4e00\u8d77\u4f7f\u7528\u7684&#xff0c;\u4e5f\u5c31\u662f\u4e1a\u52a1\u51fa\u73b0\u95ee\u9898\u540e\u88abcatch\u6355\u6349\u8fdb\u884c\u8865\u5145\u64cd\u4f5c\u4e5f\u5c31\u662f\u56de\u6eda&#xff0c;\u800c\u58f0\u660e\u5f0f\u4e8b\u52a1\u4e5f\u5c31\u662f\u4f7f\u7528\u6ce8\u89e3\u7684\u5f62\u5f0f&#xff0c;\u662f\u4e0d\u662f\u5f88\u7b80\u5355&#xff0c;\u90a3\u4ed6\u53c8\u662f\u600e\u4e48\u5b9e\u73b0\u7684\u5462&#xff1f;\u6ca1\u9519\u5c31\u662f\u57fa\u4e8eAOP\u5207\u9762\u7f16\u7a0b\u5b9e\u73b0\u7684&#xff0c;\u5c31\u5982\u4e0a\u4e00\u7bc7\u8bf4\u7684\u518dSpring\u4e0a\u4e0b\u6587\u5237\u65b0\u9636\u6bb5\u4e5f\u5c31\u662fBean\u7684\u521b\u5efa\u9636\u6bb5&#xff0c;\u4f1a\u626b\u63cf\u662f\u5426\u6709\u6ce8\u89e3&#xff0c;\u5982\u679c\u6709\u5c31\u4f1a\u751f\u6210\u52a8\u6001\u4ee3\u7406\u7684\u5b9e\u73b0\u7c7b\u5bf9\u8c61&#xff0c;\u7136\u540e\u88ab\u5bf9\u5e94\u7684\u5904\u7406Bean\u6355\u6349\u56de\u8c03invoke\u65b9\u6cd5\u3002\u4e0d\u660e\u767d\u7684\u5c0f\u4f19\u4f34\u56de\u770b\u4e3b\u5305\u7684\u524d\u51e0\u7bc7\u5427\u3002<\/p>\n<p>    &#064;Transactional(rollbackFor &#061; Exception.class) \/\/ \u58f0\u660e\u4e8b\u52a1 <\/p>\n<table>\n<tr>\u4f20\u64ad\u884c\u4e3a\u200b\u200b\u8bf4\u660e\u200b<\/tr>\n<tbody>\n<tr>\n<td>\u200bREQUIRED\u200b&#xff08;\u9ed8\u8ba4&#xff09;<\/td>\n<td>\u5982\u679c\u5f53\u524d\u6ca1\u6709\u4e8b\u52a1&#xff0c;\u5219\u65b0\u5efa\u4e00\u4e2a&#xff1b;\u5982\u679c\u5df2\u5b58\u5728\u4e8b\u52a1&#xff0c;\u5219\u52a0\u5165\u5176\u4e2d\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u200bREQUIRES_NEW\u200b<\/td>\n<td>\u603b\u662f\u65b0\u5efa\u4e8b\u52a1&#xff0c;\u5982\u679c\u5f53\u524d\u6709\u4e8b\u52a1&#xff0c;\u5219\u6302\u8d77\u5f53\u524d\u4e8b\u52a1\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u200bSUPPORTS\u200b<\/td>\n<td>\u5982\u679c\u5f53\u524d\u6709\u4e8b\u52a1&#xff0c;\u5219\u52a0\u5165&#xff1b;\u5982\u679c\u6ca1\u6709&#xff0c;\u5219\u4ee5\u975e\u4e8b\u52a1\u65b9\u5f0f\u8fd0\u884c\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u200bNOT_SUPPORTED\u200b<\/td>\n<td>\u4ee5\u975e\u4e8b\u52a1\u65b9\u5f0f\u8fd0\u884c&#xff0c;\u5982\u679c\u5f53\u524d\u6709\u4e8b\u52a1&#xff0c;\u5219\u6302\u8d77\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u200bMANDATORY\u200b<\/td>\n<td>\u5fc5\u987b\u5728\u4e8b\u52a1\u4e2d\u8fd0\u884c&#xff0c;\u5426\u5219\u629b\u51fa\u5f02\u5e38\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u200bNEVER\u200b<\/td>\n<td>\u5fc5\u987b\u5728\u975e\u4e8b\u52a1\u4e2d\u8fd0\u884c&#xff0c;\u5426\u5219\u629b\u51fa\u5f02\u5e38\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u200bNESTED\u200b<\/td>\n<td>\u5982\u679c\u5f53\u524d\u6709\u4e8b\u52a1&#xff0c;\u5219\u5d4c\u5957\u6267\u884c&#xff08;\u5b50\u4e8b\u52a1\u56de\u6eda\u4e0d\u5f71\u54cd\u7236\u4e8b\u52a1&#xff1b;\u7236\u4e8b\u52a1\u56de\u6eda\u4f1a\u5bfc\u81f4\u5b50\u4e8b\u52a1\u56de\u6eda&#xff09;\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e2a\u662f\u4e8b\u52a1\u7684\u4f20\u64ad\u884c\u4e3a\u901a\u8fc7\u00a0&#064;Transactional(propagation &#061; &#8230;)\u00a0\u914d\u7f6e&#xff09;&#xff0c;\u597d\u4e86\u5206\u5e03\u5f0f\u4e8b\u52a1\u5c31\u4e0d\u8bf4\u4e86&#xff0c;\u5177\u4f53\u4e8b\u52a1\u6709\u5173\u7684\u7b49\u4e3b\u5305\u7684\u6570\u636e\u5e93\u7cfb\u5217\u5427\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u672c\u7bc7\u4e3b\u8981\u8bf4\u540d\u4e86Spring\u548cSpringBoot\u4e4b\u524d\u7684\u533a\u522b&#xff0c;\u6c34\u4e86\u4e00\u4e0b\u52a0\u4e86\u58f0\u660e\u5f0f\u4e8b\u52a1&#xff0c;\u4e0b\u671f\u4e3b\u5305\u6682\u65f6\u8fd8\u4e0d\u77e5\u9053\u8bb2\u4ec0\u4e48\u597d&#xff0c;\u5c31\u8fd9\u4e0b\u671f\u89c1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb466\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf4\u6b21\u3002\u672c\u6587\u5bf9\u6bd4\u4e86Spring\u548cSpringBoot\u7684\u4e3b\u8981\u533a\u522b\u3002SpringFramework\u9700\u8981\u624b\u52a8\u914d\u7f6eXML\u3001\u7ba1\u7406\u4f9d\u8d56\u548c\u90e8\u7f72\u670d\u52a1\u5668\uff0c\u9002\u7528\u4e8e\u590d\u6742\u4f01\u4e1a\u5e94\u7528\uff1b\u800cSpringBoot\u901a\u8fc7\u81ea\u52a8\u914d\u7f6e\u3001starter\u4f9d\u8d56\u7ba1\u7406\u548c\u5185\u5d4c\u670d\u52a1\u5668\u7b80\u5316\u5f00\u53d1\uff0c\u9002\u5408\u5feb\u901f\u6784\u5efa\u5fae\u670d\u52a1\u6216\u5355\u4f53\u5e94\u7528\u3002\u6587\u7ae0\u8fd8\u4ecb\u7ecd\u4e86\u4e8b\u52a1\u7684ACID\u7279\u6027\uff0c\u5305\u62ec\u539f\u5b50\u6027\u3001\u4e00\u81f4\u6027\u3001\u9694\u79bb\u6027\u548c\u6301\u4e45\u6027\uff0c\u5e76\u5c55\u793a\u4e86\u624b\u52a8\u4e8b\u52a1\u548c\u58f0\u660e\u5f0f\u4e8b\u52a1\u7684\u5b9e\u73b0\u65b9\u5f0f\uff0c\u5176\u4e2d\u58f0\u660e\u5f0f\u4e8b\u52a1\u901a\u8fc7@Transactional\u6ce8\u89e3\u548cAOP\u5b9e\u73b0\u3002\u6700\u540e\u7b80\u8981\u63d0\u53ca\u4e86\u4e8b\u52a1\u7684\u4e03\u79cd\u4f20\u64ad\u884c\u4e3a\u3002<\/p>\n","protected":false},"author":2,"featured_media":57529,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,101,98,292,371],"topic":[],"class_list":["post-57531","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-spring","tag-spring-boot","tag-292","tag-371"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SpringBoot\u5b66\u4e60\u65e5\u8bb0\uff08\u516b\uff09 - \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\/57531.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SpringBoot\u5b66\u4e60\u65e5\u8bb0\uff08\u516b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb466\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf4\u6b21\u3002\u672c\u6587\u5bf9\u6bd4\u4e86Spring\u548cSpringBoot\u7684\u4e3b\u8981\u533a\u522b\u3002SpringFramework\u9700\u8981\u624b\u52a8\u914d\u7f6eXML\u3001\u7ba1\u7406\u4f9d\u8d56\u548c\u90e8\u7f72\u670d\u52a1\u5668\uff0c\u9002\u7528\u4e8e\u590d\u6742\u4f01\u4e1a\u5e94\u7528\uff1b\u800cSpringBoot\u901a\u8fc7\u81ea\u52a8\u914d\u7f6e\u3001starter\u4f9d\u8d56\u7ba1\u7406\u548c\u5185\u5d4c\u670d\u52a1\u5668\u7b80\u5316\u5f00\u53d1\uff0c\u9002\u5408\u5feb\u901f\u6784\u5efa\u5fae\u670d\u52a1\u6216\u5355\u4f53\u5e94\u7528\u3002\u6587\u7ae0\u8fd8\u4ecb\u7ecd\u4e86\u4e8b\u52a1\u7684ACID\u7279\u6027\uff0c\u5305\u62ec\u539f\u5b50\u6027\u3001\u4e00\u81f4\u6027\u3001\u9694\u79bb\u6027\u548c\u6301\u4e45\u6027\uff0c\u5e76\u5c55\u793a\u4e86\u624b\u52a8\u4e8b\u52a1\u548c\u58f0\u660e\u5f0f\u4e8b\u52a1\u7684\u5b9e\u73b0\u65b9\u5f0f\uff0c\u5176\u4e2d\u58f0\u660e\u5f0f\u4e8b\u52a1\u901a\u8fc7@Transactional\u6ce8\u89e3\u548cAOP\u5b9e\u73b0\u3002\u6700\u540e\u7b80\u8981\u63d0\u53ca\u4e86\u4e8b\u52a1\u7684\u4e03\u79cd\u4f20\u64ad\u884c\u4e3a\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/57531.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-15T06:30:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815062959-689ed3e7d01da.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=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/57531.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/57531.html\",\"name\":\"SpringBoot\u5b66\u4e60\u65e5\u8bb0\uff08\u516b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-15T06:30:57+00:00\",\"dateModified\":\"2025-08-15T06:30:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/57531.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/57531.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/57531.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SpringBoot\u5b66\u4e60\u65e5\u8bb0\uff08\u516b\uff09\"}]},{\"@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":"SpringBoot\u5b66\u4e60\u65e5\u8bb0\uff08\u516b\uff09 - \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\/57531.html","og_locale":"zh_CN","og_type":"article","og_title":"SpringBoot\u5b66\u4e60\u65e5\u8bb0\uff08\u516b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb466\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf4\u6b21\u3002\u672c\u6587\u5bf9\u6bd4\u4e86Spring\u548cSpringBoot\u7684\u4e3b\u8981\u533a\u522b\u3002SpringFramework\u9700\u8981\u624b\u52a8\u914d\u7f6eXML\u3001\u7ba1\u7406\u4f9d\u8d56\u548c\u90e8\u7f72\u670d\u52a1\u5668\uff0c\u9002\u7528\u4e8e\u590d\u6742\u4f01\u4e1a\u5e94\u7528\uff1b\u800cSpringBoot\u901a\u8fc7\u81ea\u52a8\u914d\u7f6e\u3001starter\u4f9d\u8d56\u7ba1\u7406\u548c\u5185\u5d4c\u670d\u52a1\u5668\u7b80\u5316\u5f00\u53d1\uff0c\u9002\u5408\u5feb\u901f\u6784\u5efa\u5fae\u670d\u52a1\u6216\u5355\u4f53\u5e94\u7528\u3002\u6587\u7ae0\u8fd8\u4ecb\u7ecd\u4e86\u4e8b\u52a1\u7684ACID\u7279\u6027\uff0c\u5305\u62ec\u539f\u5b50\u6027\u3001\u4e00\u81f4\u6027\u3001\u9694\u79bb\u6027\u548c\u6301\u4e45\u6027\uff0c\u5e76\u5c55\u793a\u4e86\u624b\u52a8\u4e8b\u52a1\u548c\u58f0\u660e\u5f0f\u4e8b\u52a1\u7684\u5b9e\u73b0\u65b9\u5f0f\uff0c\u5176\u4e2d\u58f0\u660e\u5f0f\u4e8b\u52a1\u901a\u8fc7@Transactional\u6ce8\u89e3\u548cAOP\u5b9e\u73b0\u3002\u6700\u540e\u7b80\u8981\u63d0\u53ca\u4e86\u4e8b\u52a1\u7684\u4e03\u79cd\u4f20\u64ad\u884c\u4e3a\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/57531.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-15T06:30:57+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250815062959-689ed3e7d01da.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/57531.html","url":"https:\/\/www.wsisp.com\/helps\/57531.html","name":"SpringBoot\u5b66\u4e60\u65e5\u8bb0\uff08\u516b\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-15T06:30:57+00:00","dateModified":"2025-08-15T06:30:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/57531.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/57531.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/57531.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"SpringBoot\u5b66\u4e60\u65e5\u8bb0\uff08\u516b\uff09"}]},{"@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\/57531","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=57531"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/57531\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/57529"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=57531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=57531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=57531"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=57531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}