{"id":14424,"date":"2021-09-20T10:07:38","date_gmt":"2021-09-20T01:07:38","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=14424"},"modified":"2023-05-27T18:34:11","modified_gmt":"2023-05-27T09:34:11","slug":"%e3%80%90ddd%e3%80%91%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3%e5%87%a6%e7%90%86%e3%81%af%e3%81%a9%e3%81%86%e3%81%99%e3%82%8b%e3%81%8b%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=14424","title":{"rendered":"\u3010DDD\u3011\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u51e6\u7406\u306f\u3069\u3046\u3059\u308b\u304b\uff1f"},"content":{"rendered":"<p>\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u51e6\u7406\u306f\u6280\u8853\u57fa\u76e4\u304c\u4e3b\u306b\u95a2\u308f\u308b\u4f4e\u6b21\u5143\u306a\u5f79\u5272\u3067\u3059\u3002<\/p>\n<p>\u666e\u901a\u306b\u66f8\u304f\u3068\u300c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d3\u30b9\u300d\u306b\u5bfe\u3057\u3066\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u8a18\u8ff0\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u304f\u306a\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u305d\u3046\u3059\u308b\u3068\u3001\u7279\u5b9a\u306e\u6280\u8853\u57fa\u76e4\u306b\u300c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d3\u30b9\u300d\u304c\u4f9d\u5b58\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u3067\u306f\u3069\u3046\u3059\u308b\u304b\uff1f<\/h2>\n<p>\u305d\u3082\u305d\u3082\u3001\u30d3\u30b8\u30cd\u30b9\u4e0a\u3082\u6574\u5408\u6027\u3068\u3044\u3046\u306e\u306f\u975e\u5e38\u306b\u5927\u304d\u306a\u6982\u5ff5\u3067\u3042\u308a\u9ad8\u6b21\u5143\u306e\u6982\u5ff5\u3067\u306f\u3042\u308a\u307e\u3059\u3002\u306a\u306e\u3067\u3001\u8a73\u7d30\u306a\u51e6\u7406\u306f\u78ba\u304b\u306b\u4f4e\u6b21\u5143\u3067\u3059\u304c\u3001<span style=\"color: #ff0000;\"><strong>\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u306e\u6574\u5408\u6027\u62c5\u4fdd\u306e\u305f\u3081\u306b\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u958b\u59cb\u3068\u7d42\u4e86\u3092\u4e3b\u5f35\u3059\u308b\u3053\u3068\u306f\u60aa\u3044\u3053\u3068\u3067\u306f\u306a\u3044<\/strong><\/span>\u306e\u3067\u3059\u3002<\/p>\n<p>\u5404\u8a00\u8a9e\u3054\u3068\u306b\u5bfe\u7b56\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>C#<\/h3>\n<p>\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30b9\u30b3\u30fc\u30d7\u3092\u4f7f\u3046\u3002<\/p>\n<pre class=\"lang:default decode:true \">using(var transaction = new TransactionScope()) {\r\n  \/\/ \u767b\u9332\u51e6\u74061\r\n  \/\/ \u767b\u9332\u51e6\u74062\r\n  transaction.Complete();\r\n}<\/pre>\n<h3>Java<\/h3>\n<p>AOP(\u30a2\u30b9\u30da\u30af\u30c8\u6307\u5411\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0)\u3092\u4f7f\u3046\u3002\u8981\u306f\u300c@Transaction\u300d\u3068\u3044\u3046\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u30e1\u30bd\u30c3\u30c9\u306e\u524d\u306b\u4ed8\u52a0\u3057\u305f\u308a\u3057\u3066\u660e\u793a\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">@Transaction(isolation = Isolation.SERIALIZABLE)\r\npublic void \u30e1\u30bd\u30c3\u30c9\u540d() {\r\n  \/\/ \u767b\u9332\u51e6\u74061\r\n  \/\/ \u767b\u9332\u51e6\u74062\r\n}<\/pre>\n<h3>\u30e6\u30cb\u30c3\u30c8\u30aa\u30d6\u30ef\u30fc\u30af\u3092\u5229\u7528\u3059\u308b\u3002<\/h3>\n<h3>\u30e6\u30cb\u30c3\u30c8\u30aa\u30d6\u30ef\u30fc\u30af<\/h3>\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5909\u66f4\u3092\u8a18\u9332\u3059\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u8aad\u307f\u53d6\u308a\u52d5\u4f5c\u3092\u884c\u3046\u969b\u306b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u72b6\u614b\u3092\u8a18\u9332\u3057\u307e\u3059\u3002\u8aad\u307f\u53d6\u3089\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u5909\u66f4\u3001\u524a\u9664\u306f\u30e6\u30cb\u30c3\u30c8\u30aa\u30d6\u30ef\u30fc\u30af\u306b\u901a\u77e5\u3057\u306a\u3044\u9650\u308a\u306f\u30c7\u30fc\u30bf\u30b9\u30c8\u30a2\u306b\u53cd\u6620\u3055\u308c\u306a\u3044\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">class \u30e6\u30cb\u30c3\u30c8\u30aa\u30d6\u30ef\u30fc\u30af {\r\n  \u767b\u9332\u30e1\u30bd\u30c3\u30c9(object value);\r\n  \u524a\u9664\u30e1\u30bd\u30c3\u30c9(object value);\r\n  \u30b3\u30df\u30c3\u30c8();\r\n}<\/pre>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306b\u30e6\u30cb\u30c3\u30c8\u30aa\u30d6\u30ef\u30fc\u30af\u306e\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u306e\u5236\u5fa1\u306a\u3069\u3092\u59d4\u8b72\u3057\u3066\u305d\u308c\u3092\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d3\u30b9\u304b\u3089\u547c\u3073\u51fa\u3057\u3066\u4f7f\u3046\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u8a73\u7d30\u306a\u5b9f\u88c5\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306fC#\u306eEntity Framework\u304c\u30e6\u30cb\u30c3\u30c8\u30aa\u30d6\u30ef\u30fc\u30af\u3092\u5b9f\u88c5\u3057\u305f\u5f62\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u305d\u3061\u3089\u3092\u53c2\u8003\u3059\u308b\u3088\u3046\u306b\u3059\u308c\u3070\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h2>\u73fe\u5b9f\u3068\u3057\u3066\u3069\u308c\u3092\u4f7f\u3046\u304b<\/h2>\n<p>\u57fa\u672c\u7684\u306b\u306f\u5ba3\u8a00\u7684\u306b\u4f7f\u3048\u305f\u65b9\u304c\u826f\u3044\u306e\u3067C#\u3067\u3042\u308c\u3070\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30b9\u30b3\u30fc\u30d7\u3092\u4f7f\u3063\u305f\u65b9\u304c\u826f\u3044\u3067\u3059\u3057\u3001Java\u3067\u3042\u308c\u3070AOP\u3067\u5b9f\u88c5\u3057\u305f\u65b9\u304c\u826f\u3044\u3067\u3057\u3087\u3046\u3002\u3082\u3057\u3001AOP\u304c\u306a\u3044\u8a00\u8a9e\u306e\u5834\u5408\u306fAOP\u306b\u6e96\u305a\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u306a\u3069\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u51e6\u7406\u306f\u6280\u8853\u57fa\u76e4\u304c\u4e3b\u306b\u95a2\u308f\u308b\u4f4e\u6b21\u5143\u306a\u5f79\u5272\u3067\u3059\u3002 \u666e\u901a\u306b\u66f8\u304f\u3068\u300c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d3\u30b9\u300d\u306b\u5bfe\u3057\u3066\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3092\u8a18\u8ff0\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u304f\u306a\u308b\u3067\u3057\u3087\u3046\u3002 \u305d\u3046\u3059\u308b\u3068\u3001\u7279\u5b9a\u306e\u6280\u8853\u57fa\u76e4\u306b\u300c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b5\u30fc\u30d3\u30b9 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[129],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/14424"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=14424"}],"version-history":[{"count":5,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/14424\/revisions"}],"predecessor-version":[{"id":20158,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/14424\/revisions\/20158"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=14424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=14424"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=14424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}