久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<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="qwawimqqmiuu" 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. 我應該將@Transactional 注釋放在哪里:在接口定義或

      Where should I put @Transactional annotation: at an interface definition or at an implementing class?(我應該將@Transactional 注釋放在哪里:在接口定義或實現類中?)
    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="qwawimqqmiuu" 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>

              • 本文介紹了我應該將@Transactional 注釋放在哪里:在接口定義或實現類中?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                代碼中標題的問題:

                @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 團隊的建議是您只使用 @Transactional 注釋來注釋具體類,而不是注釋接口.您當然可以將 @Transactional接口(或接口方法)上的 注釋,但這只會在您使用基于接口的代理時按預期工作.注釋不被繼承這一事實意味著,如果您使用基于類的代理,則基于類的代理基礎設施將無法識別事務設置,并且對象不會被包裝在事務代理中(這絕對是糟糕).所以請務必聽取 Spring 團隊的建議,只使用 @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.

                注意:由于這種機制是基于代理的,只有通過代理傳入的外部"方法調用才會被攔截.這意味著自調用",即目標內的方法對象調用目標對象的某些其他方法,即使調用的方法標有 @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!

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

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

                這篇關于我應該將@Transactional 注釋放在哪里:在接口定義或實現類中?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                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 操作數的三元表達式的類型是什么?)
                Read a text file and store every single character occurrence(讀取文本文件并存儲出現的每個字符)
                Why do I need to explicitly cast char primitives on byte and short?(為什么我需要在 byte 和 short 上顯式轉換 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="qwawimqqmiuu" 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>
                        • 主站蜘蛛池模板: 超碰人人做 | 午夜日韩视频 | 日韩在线不卡 | 久亚州在线播放 | 国产精品揄拍一区二区久久国内亚洲精 | 日本黄色的视频 | 精品久久久久久久久久久下田 | 国产乱人伦精品一区二区 | 国产一区二区三区四区 | 日本三级全黄三级a | 日韩一区二区在线视频 | 成人国产精品久久 | 羞羞在线视频 | 国产精品呻吟久久av凹凸 | 黄色一级电影在线观看 | 美人の美乳で授乳プレイ | 黄色网址免费看 | 欧美三级电影在线播放 | 日日操夜夜操视频 | 日韩精品一区二区三区视频播放 | 久久三区 | 成av在线| 国产成人精品一区二区三区在线观看 | 精品乱码一区二区三四区视频 | 欧美xxxx性| 性xxxxx| 亚洲精品一区二三区不卡 | 欧美成人第一页 | 日韩精品视频中文字幕 | 伦理午夜电影免费观看 | 国产精品视频在线播放 | 婷婷久久综合 | 美女视频h| 在线一区二区三区 | 久久久999免费视频 999久久久久久久久6666 | 亚洲福利一区 | 成人在线免费观看视频 | 亚洲国产精品一区二区三区 | 91免费在线 | 91久久久久久 | 中文字幕一区二区三区四区五区 |