{"id":100353,"date":"2020-05-03T06:50:19","date_gmt":"2020-05-02T22:50:19","guid":{"rendered":"http:\/\/4563.org\/?p=100353"},"modified":"2020-05-03T06:50:19","modified_gmt":"2020-05-02T22:50:19","slug":"%e5%a4%a7%e5%ae%b6%e5%8f%82%e6%95%b0%e5%8c%96%e5%8d%95%e6%b5%8b%e9%83%bd%e5%92%8b%e5%86%99%e7%9a%84","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=100353","title":{"rendered":"\u5927\u5bb6\u53c2\u6570\u5316\u5355\u6d4b\u90fd\u548b\u5199\u7684?"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5927\u5bb6\u53c2\u6570\u5316\u5355\u6d4b\u90fd\u548b\u5199\u7684?               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : p1094358629 <\/span>  <span><i><\/i> 69<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>background:\u6211\u53f8\u7684\u7956\u4f20\u4ee3\u7801\u662f\u624b\u52a8\u4ece csv \u8bfb\u8868\u6570\u636e,\u7136\u540e\u901a\u8fc7\u5355\u72ec\u7684 jdbc \u63d2\u5165,\u5904\u7406\u5b8c\u4e1a\u52a1\u518d\u624b\u52a8\u5220,\u4e0d\u8fc7\u4e2a\u4eba\u89c9\u5f97\u53ef\u4ee5\u7528\u5982\u4e0b\u7684\u5199\u6cd5..\u6a21\u677f\u65b9\u6cd5<\/p>\n<h3>\u4f18\u52bf:<\/h3>\n<ol>\n<li>\u652f\u6301\u4e8b\u52a1\u9694\u79bb\u6027<\/li>\n<li>\u652f\u6301\u81ea\u52a8\u56de\u6eda,\u4e0d\u7528\u624b\u52a8\u5220<\/li>\n<\/ol>\n<pre><code>   \/**      * \u6838\u5fc3\u5b9e\u73b0      *\/     @Test     public final void runWithRollBack() {         transactionTemplate.execute(new TransactionCallbackWithoutResult() {             @Override             protected void doInTransactionWithoutResult(TransactionStatus transactionStatus) {                 try {                 \/\/\u5229\u7528 spring \u7684 jdbc \u63d2\u5165                     initDBSource();                     \/\/\u4e3b\u8981\u4e1a\u52a1\u64cd\u4f5c                     mainTest();                 } catch (Exception e) {                     LOGGER.error(e);                 } finally {                     \/\/\u5f3a\u5236\u56de\u6eda                     transactionStatus.setRollbackOnly();                 }             }         });     } <\/code><\/pre>\n<p>\u8bf7\u95ee v2 \u7684\u5927\u4f6c\u600e\u4e48\u770b??<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>8<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"770488\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : p1094358629 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u633d\u56de\u4e3b\u5c0a\u4e25,\u7adf\u7136\u5224\u6211\u673a\u5668\u4eba                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"770489\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : p1094358629 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4eba\u5de5\u7f6e\u9876!!\u4e4c\u6f06\u561b\u9ed1,                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"770490\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wc951 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u5982\u679c\u53ea\u662f\u60f3\u56de\u6eda\u4e8b\u52a1\u7684\u8bdd\uff0c\u4e00\u4e2a @Transactional \u6ce8\u89e3\u5c31\u641e\u5b9a\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"770491\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : p1094358629 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wc951 \u4f60\u8bf4\u7684\u58f0\u660e\u5f0f\u4e8b\u52a1\u53ea\u6709\u5728\u5f02\u5e38\u4f1a\u56de\u6eda,\u6211\u60f3\u8981\u7684\u76ee\u7684\u662f\u6d4b\u8bd5\u5b8c\u6210,\u4e0d\u8bba\u6210\u529f\u5931\u8d25\u90fd\u56de\u6eda                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"770492\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wc951 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @p1094358629 \u4e0d\u662f\u7684\uff0c@springboottest \u91cc\u52a0\u4e0a\u8fd9\u4e2a\u4f1a\u81ea\u52a8\u56de\u6eda                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"770493\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : p1094358629 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wc951 \u5199\u8fc7 ,\u4f46\u662f\u4e0d\u751f\u6548                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"770494\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : p1094358629 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wc951 <\/p>\n<p> @Rollback<br \/> @Transactional \u8fd9\u4fe9\u6ce8\u89e3\u52a0\u4e0a\u90fd\u4e0d\u597d\u4f7f,\u662f\u56e0\u4e3a\u6211\u662f\u53c2\u6570\u5316\u6d4b\u8bd5\u7684\u5173\u7cfb\u4e48 @Parameterized.Parameters                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"782103\" data-uid=\"3\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : \u6e38\u5ba2 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u6837\u5199\u884c\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u5bb6\u53c2\u6570\u5316\u5355\u6d4b\u90fd\u548b\u5199\u7684? \u8cc7\u6df1\u5927\u4f6c&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/100353"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100353"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/100353\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100353"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}