pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

<i id='aooXF'><tr id='aooXF'><dt id='aooXF'><q id='aooXF'><span id='aooXF'><b id='aooXF'><form id='aooXF'><ins id='aooXF'></ins><ul id='aooXF'></ul><sub id='aooXF'></sub></form><legend id='aooXF'></legend><bdo id='aooXF'><pre id='aooXF'><center id='aooXF'></center></pre></bdo></b><th id='aooXF'></th></span></q></dt></tr></i><div class="bt1lxhn" id='aooXF'><tfoot id='aooXF'></tfoot><dl id='aooXF'><fieldset id='aooXF'></fieldset></dl></div>
    <bdo id='aooXF'></bdo><ul id='aooXF'></ul>

  1. <legend id='aooXF'><style id='aooXF'><dir id='aooXF'><q id='aooXF'></q></dir></style></legend>

      <tfoot id='aooXF'></tfoot>
    1. <small id='aooXF'></small><noframes id='aooXF'>

    2. 我應(yīng)該將@Transactional 注釋放在哪里:在接口定義或

      Where should I put @Transactional annotation: at an interface definition or at an implementing class?(我應(yīng)該將@Transactional 注釋放在哪里:在接口定義或?qū)崿F(xiàn)類中?)
    3. <i id='Dayyp'><tr id='Dayyp'><dt id='Dayyp'><q id='Dayyp'><span id='Dayyp'><b id='Dayyp'><form id='Dayyp'><ins id='Dayyp'></ins><ul id='Dayyp'></ul><sub id='Dayyp'></sub></form><legend id='Dayyp'></legend><bdo id='Dayyp'><pre id='Dayyp'><center id='Dayyp'></center></pre></bdo></b><th id='Dayyp'></th></span></q></dt></tr></i><div class="5dlj77p" id='Dayyp'><tfoot id='Dayyp'></tfoot><dl id='Dayyp'><fieldset id='Dayyp'></fieldset></dl></div>
          <legend id='Dayyp'><style id='Dayyp'><dir id='Dayyp'><q id='Dayyp'></q></dir></style></legend>
        • <small id='Dayyp'></small><noframes id='Dayyp'>

              • <bdo id='Dayyp'></bdo><ul id='Dayyp'></ul>
                  <tbody id='Dayyp'></tbody>
                <tfoot id='Dayyp'></tfoot>

              • 本文介紹了我應(yīng)該將@Transactional 注釋放在哪里:在接口定義或?qū)崿F(xiàn)類中?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                代碼中標(biāo)題的問題:

                @Transactional (readonly = true)
                public interface FooService {
                   void doSmth ();
                }
                
                
                public class FooServiceImpl implements FooService {
                   ...
                }
                

                public interface FooService {
                   void doSmth ();
                }
                
                @Transactional (readonly = true)
                public class FooServiceImpl implements FooService {
                   ...
                }
                

                推薦答案

                來自 http://static.springsource.org/spring/docs/2.0.x/reference/transaction.html

                Spring 團(tuán)隊(duì)的建議是您只使用 @Transactional 注釋來注釋具體類,而不是注釋接口.您當(dāng)然可以將 @Transactional接口(或接口方法)上的 注釋,但這只會在您使用基于接口的代理時(shí)按預(yù)期工作.注釋不被繼承這一事實(shí)意味著,如果您使用基于類的代理,則基于類的代理基礎(chǔ)設(shè)施將無法識別事務(wù)設(shè)置,并且對象不會被包裝在事務(wù)代理中(這絕對是糟糕).所以請務(wù)必聽取 Spring 團(tuán)隊(duì)的建議,只使用 @Transactional 注釋來注釋具體類(以及具體類的方法).

                The Spring team's recommendation is that you only annotate concrete classes with the @Transactional annotation, as opposed to annotating interfaces. You certainly can place the @Transactional annotation on an interface (or an interface method), but this will only work as you would expect it to if you are using interface-based proxies. The fact that annotations are not inherited means that if you are using class-based proxies then the transaction settings will not be recognised by the class-based proxying infrastructure and the object will not be wrapped in a transactional proxy (which would be decidedly bad). So please do take the Spring team's advice and only annotate concrete classes (and the methods of concrete classes) with the @Transactional annotation.

                注意:由于這種機(jī)制是基于代理的,只有通過代理傳入的外部"方法調(diào)用才會被攔截.這意味著自調(diào)用",即目標(biāo)內(nèi)的方法對象調(diào)用目標(biāo)對象的某些其他方法,即使調(diào)用的方法標(biāo)有 @Transactional!

                Note: Since this mechanism is based on proxies, only 'external' method calls coming in through the proxy will be intercepted. This means that 'self-invocation', i.e. a method within the target object calling some other method of the target object, won't lead to an actual transaction at runtime even if the invoked method is marked with @Transactional!

                (在第一句中添加了重點(diǎn),原文中的其他重點(diǎn).)

                (Emphasis added to the first sentence, other emphasis from the original.)

                這篇關(guān)于我應(yīng)該將@Transactional 注釋放在哪里:在接口定義或?qū)崿F(xiàn)類中?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                quot;Char cannot be dereferencedquot; error(“Char 不能被取消引用錯誤)
                Java Switch Statement - Is quot;orquot;/quot;andquot; possible?(Java Switch 語句 - 是“或/“和可能的?)
                Java Replace Character At Specific Position Of String?(Java替換字符串特定位置的字符?)
                What is the type of a ternary expression with int and char operands?(具有 int 和 char 操作數(shù)的三元表達(dá)式的類型是什么?)
                Read a text file and store every single character occurrence(讀取文本文件并存儲出現(xiàn)的每個(gè)字符)
                Why do I need to explicitly cast char primitives on byte and short?(為什么我需要在 byte 和 short 上顯式轉(zhuǎn)換 char 原語?)

              • <small id='IlN7O'></small><noframes id='IlN7O'>

                <tfoot id='IlN7O'></tfoot>
                  <bdo id='IlN7O'></bdo><ul id='IlN7O'></ul>
                    <i id='IlN7O'><tr id='IlN7O'><dt id='IlN7O'><q id='IlN7O'><span id='IlN7O'><b id='IlN7O'><form id='IlN7O'><ins id='IlN7O'></ins><ul id='IlN7O'></ul><sub id='IlN7O'></sub></form><legend id='IlN7O'></legend><bdo id='IlN7O'><pre id='IlN7O'><center id='IlN7O'></center></pre></bdo></b><th id='IlN7O'></th></span></q></dt></tr></i><div class="xbv1hxx" id='IlN7O'><tfoot id='IlN7O'></tfoot><dl id='IlN7O'><fieldset id='IlN7O'></fieldset></dl></div>

                        <legend id='IlN7O'><style id='IlN7O'><dir id='IlN7O'><q id='IlN7O'></q></dir></style></legend>
                            <tbody id='IlN7O'></tbody>
                        • 主站蜘蛛池模板: 广域铭岛Geega(际嘉)工业互联网平台-以数字科技引领行业跃迁 | 广州番禺搬家公司_天河黄埔搬家公司_企业工厂搬迁_日式搬家_广州搬家公司_厚道搬迁搬家公司 | 滚筒烘干机_转筒烘干机_滚筒干燥机_转筒干燥机_回转烘干机_回转干燥机-设备生产厂家 | DWS物流设备_扫码称重量方一体机_快递包裹分拣机_广东高臻智能装备有限公司 | 济南网站策划设计_自适应网站制作_H5企业网站搭建_济南外贸网站制作公司_锐尚 | 欧美日韩国产一区二区三区不_久久久久国产精品无码不卡_亚洲欧洲美洲无码精品AV_精品一区美女视频_日韩黄色性爱一级视频_日本五十路人妻斩_国产99视频免费精品是看4_亚洲中文字幕无码一二三四区_国产小萍萍挤奶喷奶水_亚洲另类精品无码在线一区 | 集装袋吨袋生产厂家-噸袋廠傢-塑料编织袋-纸塑复合袋-二手吨袋-太空袋-曹县建烨包装 | 钢格板|热镀锌钢格板|钢格栅板|钢格栅|格栅板-安平县昊泽丝网制品有限公司 | 锡膏喷印机-全自动涂覆机厂家-全自动点胶机-视觉点胶机-深圳市博明智控科技有限公司 | 美缝剂_美缝剂厂家_美缝剂加盟-地老板高端瓷砖美缝剂 | 吹田功率计-长创耐压测试仪-深圳市新朗普电子科技有限公司 | 车间除尘设备,VOCs废气处理,工业涂装流水线,伸缩式喷漆房,自动喷砂房,沸石转轮浓缩吸附,机器人喷粉线-山东创杰智慧 | 冷凝锅炉_燃气锅炉_工业燃气锅炉改造厂家-北京科诺锅炉 | 阴离子_阳离子聚丙烯酰胺厂家_聚合氯化铝价格_水处理絮凝剂_巩义市江源净水材料有限公司 | 卡诺亚轻高定官网_卧室系统_整家定制_定制家居_高端定制_全屋定制加盟_定制家具加盟_定制衣柜加盟 | 济南侦探调查-济南调查取证-山东私家侦探-山东白豹调查咨询公司 密集架|电动密集架|移动密集架|黑龙江档案密集架-大量现货厂家销售 | 数年网路-免费在线工具您的在线工具箱-shuyear.com | 干粉砂浆设备-干粉砂浆生产线-干混-石膏-保温砂浆设备生产线-腻子粉设备厂家-国恒机械 | 洛阳防爆合格证办理-洛阳防爆认证机构-洛阳申请国家防爆合格证-洛阳本安防爆认证代办-洛阳沪南抚防爆电气技术服务有限公司 | 迪威娱乐|迪威娱乐客服|18183620002| 网站建设-临朐爱采购-抖音运营-山东兆通网络科技 | 仿真茅草_人造茅草瓦价格_仿真茅草厂家_仿真茅草供应-深圳市科佰工贸有限公司 | 皮带机_移动皮带机_大倾角皮带机_皮带机厂家 - 新乡市国盛机械设备有限公司 | 金联宇电缆总代理-金联宇集团-广东金联宇电缆实业有限公司 | 生产自动包装秤_颗粒包装秤_肥料包装秤等包装机械-郑州鑫晟重工科技有限公司 | 石英砂矿石色选机_履带辣椒色选机_X光异物检测机-合肥幼狮光电科技 | TPE_TPE热塑性弹性体_TPE原料价格_TPE材料厂家-惠州市中塑王塑胶制品公司- 中塑王塑胶制品有限公司 | POS机办理_个人POS机免费领取 - 银联POS机申请首页 | 一体化污水处理设备-一体化净水设备-「山东梦之洁水处理」 | 折弯机-刨槽机-数控折弯机-数控刨槽机-数控折弯机厂家-深圳豐科机械有限公司 | 航空障碍灯_高中低光强航空障碍灯_民航许可认证航空警示灯厂家-东莞市天翔航天科技有限公司 | 飞行者联盟-飞机模拟机_无人机_低空经济_航空技术交流平台 | 陕西高职单招-陕西高职分类考试网| 标准光源箱|对色灯箱|色差仪|光泽度仪|涂层测厚仪_HRC大品牌生产厂家 | EPK超声波测厚仪,德国EPK测厚仪维修-上海树信仪器仪表有限公司 | 垃圾处理设备_餐厨垃圾处理设备_厨余垃圾处理设备_果蔬垃圾处理设备-深圳市三盛环保科技有限公司 | 冰晶石|碱性嫩黄闪蒸干燥机-有机垃圾烘干设备-草酸钙盘式干燥机-常州市宝康干燥 | 福州时代广告制作装饰有限公司-福州广告公司广告牌制作,福州展厅文化墙广告设计, | 公交驾校-北京公交驾校欢迎您! 工作心得_读书心得_学习心得_找心得体会范文就上学道文库 | 粒米特测控技术(上海)有限公司-测功机_减速机测试台_电机测试台 | 股指期货-期货开户-交易手续费佣金加1分-保证金低-期货公司排名靠前-万利信息开户 |