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>
                        • 主站蜘蛛池模板: 烟台金蝶财务软件,烟台网站建设,烟台网络推广 | 皮带机_移动皮带机_大倾角皮带机_皮带机厂家 - 新乡市国盛机械设备有限公司 | 【铜排折弯机,钢丝折弯成型机,汽车发泡钢丝折弯机,线材折弯机厂家,线材成型机,铁线折弯机】贝朗折弯机厂家_东莞市贝朗自动化设备有限公司 | 净化车间_洁净厂房_净化公司_净化厂房_无尘室工程_洁净工程装修|改造|施工-深圳净化公司 | 吸污车_吸粪车_抽粪车_电动三轮吸粪车_真空吸污车_高压清洗吸污车-远大汽车制造有限公司 | 深圳宣传片制作-企业宣传视频制作-产品视频拍摄-产品动画制作-短视频拍摄制作公司 | 网站制作优化_网站SEO推广解决方案-无锡首宸信息科技公司 | 塑料检查井_双扣聚氯乙烯增强管_双壁波纹管-河南中盈塑料制品有限公司 | 河南砖机首页-全自动液压免烧砖机,小型砌块水泥砖机厂家[十年老厂] | 玻璃钢型材-玻璃钢风管-玻璃钢管道,生产厂家-[江苏欧升玻璃钢制造有限公司] | 全自动不干胶贴标机_套标机-上海今昂贴标机生产厂家 | 解放卡车|出口|济南重汽|报价大全|山东三维商贸有限公司 | 环氧乙烷灭菌器_压力蒸汽灭菌器_低温等离子过氧化氢灭菌器 _低温蒸汽甲醛灭菌器_清洗工作站_医用干燥柜_灭菌耗材-环氧乙烷灭菌器_脉动真空压力蒸汽灭菌器_低温等离子灭菌设备_河南省三强医疗器械有限责任公司 | 非甲烷总烃分析仪|环控百科 | 大型果蔬切片机-水果冬瓜削皮机-洗菜机切菜机-肇庆市凤翔餐饮设备有限公司 | 政府回应:200块在义乌小巷能买到爱情吗?——揭秘打工族省钱约会的生存智慧 | 昆明网络公司|云南网络公司|昆明网站建设公司|昆明网页设计|云南网站制作|新媒体运营公司|APP开发|小程序研发|尽在昆明奥远科技有限公司 | 微水泥_硅藻泥_艺术涂料_艺术漆_艺术漆加盟-青岛泥之韵环保壁材 武汉EPS线条_EPS装饰线条_EPS构件_湖北博欧EPS线条厂家 | 净化车间_洁净厂房_净化公司_净化厂房_无尘室工程_洁净工程装修|改造|施工-深圳净化公司 | 大功率金属激光焊接机价格_不锈钢汽车配件|光纤自动激光焊接机设备-东莞市正信激光科技有限公司 定制奶茶纸杯_定制豆浆杯_广东纸杯厂_[绿保佳]一家专业生产纸杯碗的厂家 | 喷漆房_废气处理设备-湖北天地鑫环保设备有限公司 | 世纪豪门官网 世纪豪门集成吊顶加盟电话 世纪豪门售后电话 | 塑钢件_塑钢门窗配件_塑钢配件厂家-文安县启泰金属制品有限公司 深圳南财多媒体有限公司介绍 | 高硼硅玻璃|水位计玻璃板|光学三棱镜-邯郸奥维玻璃科技有限公司 高温高压釜(氢化反应釜)百科 | 列管冷凝器,刮板蒸发器,外盘管反应釜厂家-无锡曼旺化工设备有限公司 | 并网柜,汇流箱,电控设备,中高低压开关柜,电气电力成套设备,PLC控制设备订制厂家,江苏昌伟业新能源科技有限公司 | 纳米涂料品牌 防雾抗污纳米陶瓷涂料厂家_虹瓷科技 | 净化车间装修_合肥厂房无尘室设计_合肥工厂洁净工程装修公司-安徽盛世和居装饰 | 中图网(原中国图书网):网上书店,尾货特色书店,30万种特价书低至2折! | MES系统-WMS系统-MES定制开发-制造执行MES解决方案-罗浮云计算 | 不锈钢散热器,冷却翅片管散热器厂家-无锡市烨晟化工装备科技有限公司 | 广州企亚 - 数码直喷、白墨印花、源头厂家、透气无手感方案服务商! | 阿里巴巴诚信通温州、台州、宁波、嘉兴授权渠道商-浙江联欣科技提供阿里会员办理 | 太原装修公司_山西整装家装设计_太原室内装潢软装_肖邦家居 | 拖链电缆_柔性电缆_伺服电缆_坦克链电缆-深圳市顺电工业电缆有限公司 | 3D全息投影_地面互动投影_360度立体投影_水幕灯光秀 | 广东银虎 蜂窝块状沸石分子筛-吸附脱硫分子筛-萍乡市捷龙环保科技有限公司 | 全自动包装秤_全自动上袋机_全自动套袋机_高位码垛机_全自动包装码垛系统生产线-三维汉界机器(山东)股份有限公司 | 专业的新乡振动筛厂家-振动筛品质保障-环保振动筛价格—新乡市德科筛分机械有限公司 | 对辊破碎机-液压双辊式,强力双齿辊,四辊破碎机价格_巩义市金联机械设备生产厂家 | 阻燃剂-氢氧化镁-氢氧化铝-沥青阻燃剂-合肥皖燃新材料 | 江西自考网-江西自学考试网 |