<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    eric-1001c

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      3 隨筆 :: 45 文章 :: 12 評論 :: 0 Trackbacks
    Let me first of all state the expected behavior: Silently marking a transaction as rollback-only through a setRollbackOnly call will work as long as you do it at the *outermost* transaction level. If you do it within an inner transaction scope, the outer transaction will see this as a "global" rollback-only and throw an UnexpectedRollbackException - since the code in the outer transaction did not explicitly ask for a rollback, so needs to be notified.

    So in your scenario, I would assume that you do the setRollbackOnly within an inner transaction scope. Since you're using <tx:advice>, this could mean that your pointcut is too broad and applies transaction demarcation at multiple levels: for example, at the Controller level as well as at the service level, with the setRollbackOnly call happening in a service - this would lead to an UnexpectedRollbackException at the Controller level.

    That said, I would actually argue that you should virtually never be using a programmatic setRollbackOnly call in the first place, or more specifically, a rollback without exception thrown to the caller. This usually indicates inappropriate transaction scopes.

    In particular, web data binding should *not* happen within a transaction. Rather, perform data binding without transaction first, then start transactions at the service level *once you decided to process the bound data*, with the bound data brought into the transaction through a merge operation. This way, validation errors don't require a transaction rollback in the first place...

    Aside from avoiding programmatic setRollbackOnly calls in your application code, the above approach to validation and transactions also avoids excessive rollbacks in your transaction statistics. Such rollbacks for frequent and perfectly normal user interactions should in particular be avoided in administered environments like a J2EE server installation - with transaction monitoring and (potentially) escalation messages generated for rollbacks.
    posted on 2008-04-05 12:36 Eric-1001c 閱讀(216) 評論(0)  編輯  收藏 所屬分類: Hibernate
    主站蜘蛛池模板: 国产精品V亚洲精品V日韩精品 | 手机永久免费的AV在线电影网| 99re热精品视频国产免费| 日韩亚洲一区二区三区| 天黑黑影院在线观看视频高清免费| 亚洲日韩国产一区二区三区| 成人国产网站v片免费观看| 免费人成激情视频| 成人福利在线观看免费视频| 青青草原亚洲视频| 日本视频在线观看永久免费| 亚洲黄色免费观看| www.黄色免费网站| 色九月亚洲综合网| 精品亚洲视频在线观看 | 一级毛片在线免费视频| 美腿丝袜亚洲综合| 日韩免费无码视频一区二区三区| 久久亚洲sm情趣捆绑调教| 男女超爽刺激视频免费播放| 亚洲日本VA中文字幕久久道具| 成人永久福利免费观看| 人与动性xxxxx免费| 亚洲Av无码专区国产乱码DVD| 日本免费xxxx| 美女的胸又黄又www网站免费| 国产亚洲人成网站在线观看 | 2021国内精品久久久久精免费| 亚洲日韩国产精品乱-久| www亚洲一级视频com| 免费a级毛片无码a∨免费软件| 亚洲国产综合人成综合网站00| 日本不卡高清中文字幕免费| 免费看一区二区三区四区| 中国亚洲呦女专区| 亚洲一区二区三区香蕉| 一二三四免费观看在线视频中文版| 男人和女人高潮免费网站| 亚洲色偷偷av男人的天堂| 亚洲国色天香视频| 日韩免费一级毛片|